home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 2 / ETO Development Tools 2.iso / Essentials / MPW 411 / MPWHelp < prev    next >
Encoding:
Text File  |  1990-10-24  |  374.9 KB  |  10,644 lines  |  [TEXT/MPS ]

  1. æKY CopyrightNotice
  2. æC  Copyright Apple Computer, Inc. 1986-1990, All rights reserved.
  3. 411 - MPW Help - MPW 3.2 Beta Release.
  4. Tuesday, Oct 2, 1990 11:53:46 AM
  5.  
  6. MPW 3.2 Help Summaries
  7.  Help information is available for each of the MPW commands.  
  8.  To see the list of commands select Help and type command - 1. In addition, 
  9.  brief descriptions of Expressions, Patterns, Selections, Characters,
  10.  Shortcuts, Variables, and Projector are also included.
  11.  
  12.  To see Help summaries, Select one of the following and type command - 1
  13.  
  14.  a commandName  # information about commandName
  15.  Commands       # a list of commands
  16.  Expressions    # summary of expressions
  17.  Patterns       # summary of patterns (regular expressions)
  18.  Selections     # summary of selections
  19.  Characters     # summary of MPW Shell special characters
  20.  Shortcuts      # summary of MPW Shell shortcuts
  21.  Variables      # summary of the standard MPW shell variables
  22.  Projector      # summary of Projector, a project/source control system
  23.  
  24.  Copyright Apple Computer, Inc. 1986-1990
  25.  All rights reserved.
  26.  
  27. æKY Commands
  28. æC              MPW Commands -- A list of MPW executable commands
  29.  
  30.  AddMenu         # add a menu item
  31.  AddPane         # split the window into panes
  32.  Adjust          # adjust lines
  33.  Alert           # display an alert box
  34.  Alias           # define or write command aliases
  35.  Align           # align text to left margin
  36.  Asm             # MC68xxx Macro Assembler
  37.  AsmCvtIIGS      # converts APW Assembler source files to AsmIIGS format
  38.  AsmIIGS         # the MPW IIGS Assembler
  39.  AsmMatIIGS      # Assembler source formatter
  40.  Backup          # folder file backup
  41.  Beep            # generate tones
  42.  Begin           # group commands
  43.  Break           # break from For or Loop
  44.  Browser         # invoke Marker Browser
  45.  BuildCommands   # show build commands
  46.  BuildMenu       # create the Build menu
  47.  BuildMenuIIGS   # adds CreateMakeIIGS to the Build menu
  48.  BuildProgram    # build the specified program
  49.  C               # C compiler
  50.  Canon           # canonical spelling tool
  51.  Catenate        # concatenate files
  52.  CFront          # C++ to C translator
  53.  CheckIn         # check a file into a project
  54.  CheckOut        # check a file out from a project
  55.  CheckOutDir     # specify the directory where checked out files will placed
  56.  Choose          # choose or list network file server volumes and printers
  57.  CIIGS           # the MPW IIGS C Compiler
  58.  Clear           # clear the selection
  59.  Close           # close specified windows
  60.  CMarker         # generate Mark commands for C and C++ function definitions
  61.  Commando        # present a dialog interface for commands
  62.  Compare         # compare text files
  63.  CompareFiles    # compare text files and interactively view differences
  64.  CompareRevisions# compare two revisions of a file in a project
  65.  Confirm         # display a confirmation dialog box
  66.  Continue        # continue with next iteration of For or Loop
  67.  Copy            # copy selection to Clipboard
  68.  Count           # count lines and characters
  69.  CPlus           # script to compile C++ source
  70.  CreateMake      # create a simple makefile
  71.  CreateMakeIIGS  # creates Make files that build IIGS programs
  72.  Cut             # copy selection to Clipboard and delete it
  73.  Date            # write the date and time
  74.  Delete          # delete files and directories
  75.  DeleteMenu      # delete user-defined menus and menu items
  76.  DeleteNames     # delete user-defined symbolic names
  77.  DeletePane      # delete panes from the window
  78.  DeleteRevisions # delete previous revisions of files in a project
  79.  DeRez           # resource decompiler
  80.  DeRezIIGS       # resource decompiler for Apple IIGS
  81.  Directory       # set or write the default directory
  82.  DirectoryMenu   # create the Directory menu
  83.  DoIt            # highlight and execute a series of shell commands
  84.  DumpCode        # write formatted CODE resources
  85.  DumpFile        # display contents of any file
  86.  DumpObj         # write formatted object file
  87.  DumpObjIIGS     # dumps OMF files
  88.  Duplicate       # duplicate files and directories
  89.  DuplicateIIGS   # moves files between Mac and GS/OS volumes
  90.  Echo            # echo parameters
  91.  Eject           # eject volumes
  92.  Entab           # convert runs of spaces to tabs
  93.  Equal           # compare files and directories
  94.  Erase           # initialize volumes
  95.  Evaluate        # evaluate an expression
  96.  Execute         # execute command file in the current scope
  97.  Exists          # confirm the existence of a file or directory
  98.  Exit            # exit from a command file
  99.  Export          # make variables available to commands
  100.  ExpressIIGS     # converts files from OMF to ExpressLoad format
  101.  FileDiv         # divide a file into several smaller files
  102.  Files           # list files and directories
  103.  Find            # find and select a text pattern
  104.  Flush           # flush the tools that the Shell has cached
  105.  For             # repeat commands once per parameter
  106.  Format          # set or display formatting options for a window
  107.  Get             # get information about a key word from a data file
  108.  GetErrorText    # display error messages based on message number
  109.  GetFileName     # display a Standard File dialog box
  110.  GetListItem     # display items for selection in a dialog box
  111.  Help.MPW        # write summary information
  112.  If              # conditional command execution
  113.  Lib             # combine object files into a library file
  114.  Line            # find line in the target window
  115.  Link            # link an application, tool, or resource
  116.  LinkIIGS        # the MPW IIGS Linker
  117.  Loop            # repeat commands until Break
  118.  Make            # build up-to-date version of a program
  119.  MakeErrorFile   # create error message textfile
  120.  MakeBinIIGS     # converts Load files to Binary files
  121.  MakeLibIIGS     # creates IIGS Library files
  122.  Mark            # assign a marker to a selection
  123.  Markers         # list markers
  124.  MatchIt         # semi-intelligent language sensitive bracket matcher
  125.  MergeBranch     # merge a branch revision onto the trunk
  126.  ModifyReadOnly  # enables a read-only Projector file to be edited
  127.  Mount           # mount volumes
  128.  MountProject    # mount projects
  129.  Move            # move files and directories
  130.  MoveWindow      # move window to h,v location
  131.  NameRevisions   # define a symbolic name
  132.  New             # open a new window
  133.  Newer           # compare modification dates of files
  134.  NewFolder       # create a new folder
  135.  NewProject      # create a new project
  136.  Open            # open file(s) in window(s)
  137.  OrphanFiles     # remove Projector information from a list of files
  138.  Parameters      # write parameters
  139.  Pascal          # Pascal compiler
  140.  PascalIIGS      # the MPW IIGS Pascal Compiler
  141.  PasMat          # Pascal programs formatter
  142.  PasRef          # Pascal cross-referencer
  143.  Paste           # replace selection with Clipboard contents
  144.  PerformReport   # generate a performance report
  145.  Position        # display current line position
  146.  Print           # print text files
  147.  ProcNames       # display Pascal procedure and function names
  148.  Project         # set or write the current project
  149.  ProjectInfo     # display information about a Project
  150.  Quit            # quit MPW
  151.  Quote           # echo parameters, quoting if needed
  152.  Rename          # rename files and directories
  153.  Replace         # replace the selection
  154.  Request         # request text from a dialog box
  155.  ResEqual        # compares the resources in two files
  156.  ResEqualIIGS    # compares the resources in two IIGS files
  157.  Revert          # revert window to previous saved state
  158.  Rez             # resource compiler
  159.  RezDet          # detect inconsistencies in resources
  160.  RezIIGS         # resource compiler
  161.  RotateWindows   # send active (frontmost) window to back
  162.  Save            # save specified windows
  163.  SaveOnClose     # set save behavior when closing windows
  164.  Search          # search files for pattern
  165.  Set             # define or write Shell variables
  166.  SetDirectory    # set the default directory
  167.  SetFile         # set file attributes
  168.  SetPrivilege    # set access privileges for directories on file servers
  169.  SetVersion      # maintain version and revision number
  170.  Shift           # renumber command file positional parameters
  171.  ShowSelection   # place the selection within an editor window
  172.  Shutdown        # power down or restart the machine
  173.  SizeWindow      # set a window's size
  174.  Sort            # sort or merge lines of text
  175.  StackWindows    # arrange windows diagonally
  176.  StreamEdit      # scriptable text editor
  177.  Target          # make a window the target window
  178.  TileWindows     # arrange windows in a tiled fashion
  179.  TransferCkid    # move Projector information from one file to another
  180.  Translate       # translate characters
  181.  Unalias         # remove aliases
  182.  Undo            # undo the last edit
  183.  Unexport        # remove variable definitions from the export list
  184.  Unmark          # remove a marker from a window
  185.  Unmount         # unmount volumes
  186.  UnmountProject  # unmount projects
  187.  Unset           # remove Shell variable definitions
  188.  UserVariables   # uses Commando to set all the user variables
  189.  Version         # print the version of the MPW Shell
  190.  Volumes         # list mounted volumes
  191.  WhereIs         # find the location of a file
  192.  Which           # determine which file the shell will execute
  193.  Windows         # list windows
  194.  ZoomWindow      # enlarge or reduce a window's size
  195.  
  196. æKY Help
  197. MPWHelp
  198.  
  199. æKL About411
  200. Characters
  201. Commands
  202. Expressions
  203. Patterns
  204. Projector
  205. Selections
  206. Shortcuts
  207. Variables
  208.  
  209. AddMenu
  210. AddPane
  211. Adjust
  212. Alert
  213. Alias
  214. Align
  215. Asm
  216. AsmCvtIIGS
  217. AsmIIGS
  218. AsmMatIIGS
  219. Backup
  220. Beep
  221. Begin
  222. Break
  223. BuildCommands
  224. BuildMenu
  225. BuildMenuIIGS
  226. BuildProgram
  227. C
  228. Canon
  229. Catenate
  230. CFront
  231. CheckIn
  232. CheckOut
  233. CheckOutDir
  234. Choose
  235. CIIGS
  236. Clear
  237. Close
  238. CMarker
  239. Commando
  240. Compare
  241. CompareFiles
  242. CompareRevisions
  243. Confirm
  244. Continue
  245. Copy
  246. Count
  247. CPlus
  248. CreateMake
  249. CreateMakeIIGS
  250. Cut
  251. Date
  252. Delete
  253. DeleteMenu
  254. DeleteNames
  255. DeletePane
  256. DeleteRevisions
  257. DeRez
  258. DeRezIIGS
  259. Directory
  260. DirectoryMenu
  261. DoIt
  262. DumpCode
  263. DumpFile
  264. DumpObj
  265. DumpObjIIGS
  266. Duplicate
  267. DuplicateIIGS
  268. Echo
  269. Eject
  270. Entab
  271. Equal
  272. Erase
  273. Evaluate
  274. Execute
  275. Exists
  276. Exit
  277. Export
  278. ExpressIIGS
  279. FileDiv
  280. Files
  281. Find
  282. Flush
  283. For
  284. Format
  285. Get
  286. GetErrorText
  287. GetFileName
  288. GetListItem
  289. Help.MPW
  290. If
  291. Lib
  292. Line
  293. Link
  294. LinkIIGS
  295. Loop
  296. Make
  297. MakeBinIIGS
  298. MakeErrorFile
  299. MakeLibIIGS
  300. Mark
  301. Markers
  302. MatchIt
  303. MergeBranch
  304. ModifyReadOnly
  305. Mount
  306. MountProject
  307. Move
  308. MoveWindow
  309. NameRevisions
  310. New
  311. Newer
  312. NewFolder
  313. NewProject
  314. Open
  315. OrphanFiles
  316. Parameters
  317. Pascal
  318. PascalIIGS
  319. PasMat
  320. PasRef
  321. Paste
  322. PerformReport
  323. Position
  324. Print
  325. ProcNames
  326. Project
  327. ProjectInfo
  328. Quit
  329. Quote
  330. Rename
  331. Replace
  332. Request
  333. ResEqual
  334. ResEqualIIGS
  335. Revert
  336. Rez
  337. RezIIGS
  338. RezDet
  339. RotateWindows
  340. Save
  341. SaveOnClose
  342. Search
  343. Set
  344. SetDirectory
  345. SetFile
  346. SetPrivilege
  347. SetVersion
  348. Shift
  349. ShowSelection
  350. Shutdown
  351. SizeWindow
  352. Sort
  353. StackWindows
  354. StreamEdit
  355. Target
  356. TileWindows
  357. TransferCkid
  358. Translate
  359. Unalias
  360. Undo
  361. Unexport
  362. Unmark
  363. Unmount
  364. UnmountProject
  365. Unset
  366. UserVariables
  367. Version
  368. Volumes
  369. WhereIs
  370. Which
  371. Windows
  372. ZoomWindow
  373. æKY Variables
  374. æC                  Variables defined by the MPW Shell:
  375.  
  376.  {Active}          full pathname of current active window
  377.  {Aliases}         list of all defined aliases
  378.  {Boot}            volume name of the boot disk
  379.  {Command}         full pathname of the last command executed
  380.  {MPW}             full pathname of the Macintosh Programmer's Workshop.
  381.  {ShellDirectory}  full pathname of the directory that contains the MPW Shell
  382.  {Status}          result of the last command executed (0 means successful)
  383.  {SystemFolder}    full pathname of the system folder
  384.  {Target}          full pathname of the target window
  385.  {User}            the current user name (initialized to the “Chooser” name)
  386.  {Windows}         list of current windows     
  387.  {Worksheet}       full pathname of the Worksheet window
  388.  
  389.  Variables used by the MPW Shell:
  390.  
  391.  {Commando}        name of the commando tool
  392.  {Commands}        list of directories to search for commands
  393.  {DirectoryPath}   list of common directories to speed changing directories
  394.  {Echo}            control the echoing of commands to diagnostic output
  395.  {Exit}            control script termination based on {Status}
  396.  {IgnoreCmdPeriod} control use of cmd-. during critical sections
  397.  {HideHelpKey}     deactivate "help" key on extended keyboard
  398.  {Test}            control execution of tools and applications
  399.  {AutoIndent}      auto indent setting used for new windows
  400.  {CaseSensitive}   control case sensitivity for searching
  401.  {Font}            font used for new windows
  402.  {FontSize}        font size used for new windows
  403.  {NewWindowRect}   window rectangle used for new windows (top,left,bottom,right)
  404.  {PrintOptions}    options used by the print menu commands
  405.  {SearchBackward}  control direction of searching
  406.  {SearchType}      control type of searching (literal/word/expression)
  407.  {SearchWrap}      control wrap-around search
  408.  {StackOptions}    options used by the Stack Windows menu command
  409.  {Tab}             tab size used for new windows
  410.  {TileOptions}     options used by the Tile Windows menu command
  411.  {WordSet}         set of characters that constitue a word
  412.  {ZoomWindowRect}  window rectangle used for a zoomed window (top,left,bottom,right)
  413.  
  414.  Variables automatically set before script execution:
  415.  
  416.  {0}               name of the currently executing script
  417.  {1}, {2}, … {n}   first, second, and nth parameter to the script
  418.  {#}               number of parameters
  419.  {Parameters}      equivalent to {1} {2} … {n}
  420.  {"Parameters"}    equivalent to "{1}" "{2}" … "{n}"
  421.  
  422.  Variables used for libraries and include files:
  423.  
  424.  {AIncludes}       directories to search for assemby-language include files        
  425.  {CIncludes}       directories to search for C include files
  426.  {CLibraries}      directory containing C library files
  427.  {Libraries}       directory containing shared library files
  428.  {PInterfaces}     directory containing Pascal interface files
  429.  {PLibraries}      directory containing Pascal library files
  430.  {RIncludes}       directory containing Rez include files
  431.  
  432. æKY Characters
  433. æC   The characters listed below have special meanings in the command language.
  434.  
  435.  
  436.  Space           Space separates words.
  437.  Tab             Tab also separates words.
  438.  
  439.  Return          Return separates commands.
  440.  ;               Semicolon also separates commands.
  441.  |               Pipe separates commands and pipes output to input.
  442.  &&              And separates commands, executing second if first succeeds.
  443.  ||              Or separates commands, executing second if first fails.
  444.  (…)             Parenthesis group commands.
  445.                  Parenthesis also group characters in filename patterns.
  446.  
  447.  #               Comment begins comments.
  448.  
  449.  ∂               Escape (Option-D) quotes the following character.
  450.  '…'             Single quote quotes all other characters.
  451.  "…"             Double quote quotes all characters except ∂, {, and `.
  452.  /…/             Slash quotes all characters except ∂, {, and `.
  453.  \…\             Backslash quotes all characters except ∂, {, and `.
  454.  
  455.  {…}             Braces denote variable substitution.
  456.  `…`             Backquotes denote command substitution.
  457.  
  458.  ?               Question mark matches any character in filename patterns.
  459.  ≈               Approximately (Option-X) matches any string in patterns.
  460.  […]             Brackets enclose character sets in filename patterns.
  461.  *               Star indicates zero or more repetitions in patterns.
  462.  +               Plus indicates one or more repetitions in patterns.
  463.  «…»             European quotes (Option-\ and Option-Shift-\) enclose
  464.                  repeat counts.
  465.  
  466.  <               Less-than indicates an input file specification.
  467.  >               Greater-than indicates an output file specification.
  468.  >>              Indicates appending to an output file specification.
  469.  ≥               Greater-than-or-equal indicates a diagnostic specification.
  470.  ≥≥              Indicates appending to a diagnostic file specification.
  471.  ∑               Capital sigma (option-w) indicates both an output file and
  472.                  diagnostic output file specification.
  473.  ∑∑              Indicates appending to the output and diagnostic file
  474.                  specification.
  475.  
  476.  …               Elipsis (Option-;) signals the Shell to use Commando
  477.  
  478. æKY Expressions
  479. æC  Expressions
  480.  
  481.  Numbers may be expressed in decimal, hexadecimal, octal, or
  482.  binary.  Any of the following formats may be used:
  483.  
  484.  [0-9]+          decimal number
  485.  0x[0-9a-f]+     hexadecimal number
  486.  $[0-9a-f]+      hexadecimal number
  487.  0[0-7]+         octal number
  488.  0b[01]+         binary number
  489.  
  490.  The operators listed below are used in expressions in the
  491.  Evaluate, If, Else If, Break, Continue, and Exit commands. 
  492.  
  493.  Alternate spellings of several operators are provided.
  494.  All of the operators are evaluated from left to right.
  495.  Operators with the highest precedence are listed first,
  496.  and operators in the same group have equal precedence.
  497.  
  498.  
  499.  (…)             expression grouping
  500.  
  501.  -               unary negation
  502.  ~               bitwise negation
  503.  !    NOT  ¬     logical NOT (¬ is Option-L)
  504.  
  505.  *               multiplication
  506.  ÷    DIV        division (÷ is Option-/)
  507.  %    MOD        modulus division
  508.  
  509.  +               addition
  510.  -               subtraction
  511.  
  512.  <<              shift left
  513.  >>              shift right
  514.  
  515.  <               less than
  516.  <=   ≤          less than or equal to (≤ is Option-<)
  517.  >               greater than
  518.  >=   ≥          greater than or equal to (≥ is Option->)
  519.  
  520.  ==              equal
  521.  !=   <>   ≠     not equal (≠ is Option-=)
  522.  =~              equal to a pattern
  523.  !~              not equal to a pattern
  524.  
  525.  &               bitwise AND
  526.  
  527.  ^               bitwise XOR
  528.  
  529.  |               bitwise OR
  530.  
  531.  &&   AND        logical AND
  532.  
  533.  ||   OR         logical OR
  534.  
  535. æKY Selections
  536. æC      Selections - selections specify a selection or insertion point
  537.  
  538.  §                    current selection (Option-6)
  539.  n                    line number n
  540.  !n                   line n lines after end of current selection
  541.  ¡n                   line n lines before start of selection (Option-1)
  542.  position             position (defined below)
  543.  markerName           selection marked by markerName
  544.  pattern              pattern  (defined below)
  545.  (selection)          selection grouping
  546.  selection:selection  both selections and everything in between
  547.  
  548. position - positions specify an insertion point
  549.  
  550.  •                    position before first character of file (Option-8)
  551.  ∞                    position after last character of file (Option-5)
  552.  Δselection           position before first character of selection (Option-J)
  553.  selectionΔ           position after last character of selection (Option-J)
  554.  selection!n          position n characters after selection
  555.  selection¡n          position n characters before selection (Option-!)
  556.  
  557. pattern - patterns specify characters to be matched
  558.  
  559.  /entireRE/           regular expression - search forward
  560.  \entireRE\           regular expression - search backward
  561.  
  562.  Help Patterns           # See "Help Patterns" for more information.
  563.  
  564. æKY Patterns
  565. æC  Patterns - Patterns specify characters to be matched
  566.  /entireRE/           regular expression - search forward
  567.  \entireRE\           regular expression - search backward
  568.  
  569. entireRE
  570.  
  571.  •RE                  regular expression at beginning of line (Option-8)
  572.  RE∞                  regular expression at end of line (Option-5)
  573.  RE                   regular expression
  574.  
  575. RE
  576.  
  577.  simpleExpr           simple regular expression - defined below
  578.  (RE)®digit           tagged RE - refer to match as ®digit (Option-R)
  579.  'string'             literal - no characters within '…' are special
  580.  "string"             literal - only ∂, {, and ` are special within "…"
  581.  RE1RE2               regular expression RE1 followed by RE2
  582.  
  583. simpleExpr
  584.  
  585.  (RE)                 regular expression grouping
  586.  charExpr             single character regular expression - defined below
  587.  simpleExpr*          simple expression zero or more times
  588.  simpleExpr+          simple expression one of more times
  589.  simpleExpr«n»        simple expression n times (Option-\, Option-Shift-\)
  590.  simpleExpr«n,»       simple expression at least n times
  591.  simpleExpr«n1,n2»    simple expression at least n1, at most n2 times
  592.  
  593. charExpr
  594.  
  595.  character            character (unless it has special meaning)
  596.  ∂character           character - defeats any special meaning (Option-D)
  597.  ?                    any character except Return
  598.  ≈                    zero or more characters, except Return (Option-X)
  599.  [charList]           any character in the list
  600.  [¬charList]          any character not in the list (Option-L)
  601.  
  602. charList
  603.  
  604.  [                    [ first in the list represents itself
  605.  ]                    ] first in the list represents itself
  606.  -                    - first in the list represents itself
  607.  character            character
  608.  charList character   list of characters
  609.  character-character  character range (e.g. A-Z)
  610.  
  611. æKY ShortCuts
  612. æC   The following is a list of MPW Shell shortcuts:
  613.  
  614.  Double click        select word
  615.  Triple click        select line
  616.  Double Clicking on any of the characters (,),[,],{,},',",/,\,` will select
  617.      everything between the character and its mate.
  618.  
  619.  UpArrow             move selection point one line above current selection
  620.  DownArrow           move selection point one line below current selection
  621.  RightArrow          move selection point one character to the right
  622.  LeftArrow           move selection point one character to the left
  623.  
  624.  Opt-LeftArrow       move selection point one word to the left
  625.  Opt-RightArrow      move selection point one word to the right
  626.  CMD-Shift-UpArrow   move selection point to top of file
  627.  CMD-Shift-DownArrow move selection point to bottom of file
  628.  CMD-DownArrow       move selection point down one screen size
  629.  CMD-RightArrow      move selection point to right edge of current line
  630.  CMD-UpArrow         move selection point up one screen size
  631.  CMD-LeftArrow       move selection point to left edge of current line
  632.  
  633.  Backspace           delete character to the left
  634.  Clear               delete character to the right
  635.  Opt-Backspace       delete word to the left
  636.  Opt-Clear           delete word to the right
  637.  CMD-Backspace       delete from current selection to end of file
  638.  CMD-Shift-Backspace delete from current selection to top of file
  639.  Opt-Shift-Backspace delete word to the right
  640.  
  641.  
  642.  Searching shortcuts
  643.      CMD-Shift-G        reverse the direction of "Find Same"
  644.      CMD-Shift-H        reverse the direction of "Find Selection"
  645.      CMD-Shift-T     reverse the direction of "Replace Same"
  646.      Holding down Shift while selecting OK will reverse the direction 
  647.          of "Find" and "Find and Replace"
  648.  
  649.  Holding down Option while selecting "Tile Windows" or "Stack Windows"
  650.      will include the worksheet in the tiling or stacking
  651.  Holding down Option while pressing Return will disable auto-indent
  652.      for that line.
  653.  Holding down Option while pressing Enter will invoke Commando on that
  654.      command line.
  655.  
  656.  In Dialogs without an EditText item
  657.      Y               Yes
  658.      N               No
  659.      CMD .           Cancel
  660.      ESC             Cancel
  661.  
  662. æKY Projector
  663. æC   Projector is a collection of built–in MPW commands and windows that
  664.  help programmers (both individuals and teams) control and account for
  665.  changes to all the files (documentation, source, applications etc.)
  666.  associated with a software project.
  667.  
  668.  Here is a brief summary of the commands (the CheckIn, CheckOut, and
  669.  NewProject commands also have windows that can be opened using the
  670.  “-w” option to the respective command):
  671.  
  672.  CheckIn          # check a file into a project
  673.  CheckOut         # check a file out from a project
  674.  CheckOutDir      # specify the directory where checked out files will placed
  675.  CompareRevisions # compare two revisions of a file in a project
  676.  DeleteNames      # delete user-defined symbolic names
  677.  DeleteRevisions  # delete previous revisions of files in a project
  678.  MergeBranch      # merge a branch revision onto the trunk
  679.  ModifyReadOnly   # enables a read-only Projector file to be edited
  680.  MountProject     # mount projects
  681.  NameRevisions    # define a symbolic name
  682.  NewProject       # create a new project
  683.  OrphanFiles      # remove Projector information from a list of files
  684.  Project          # set or write the current project
  685.  ProjectInfo      # display information about a Project
  686.  TransferCkid     # move Projector information from one file to another
  687.  UnmountProject   # unmount projects
  688.  
  689.                              Examples
  690.  
  691.   The command
  692.  
  693.   Project
  694.  
  695.   causes the current project name to be written to standard output.
  696.   To change the current project to OurProject, use
  697.  
  698.   Project OurProject
  699.  
  700.  
  701.                              See also 
  702.  
  703.   NewProject, MountProject.
  704.  
  705.  
  706. æKY About411
  707. æC         
  708. About “411”
  709. “411” provides a way for Macintosh developers to achieve rapid retrieval of software de-
  710. velopment information while using Apple's MPW development system. The access can be 
  711. via menus and command keys or from command line entries.  The software development 
  712. information includes language-specific Inside Macintosh documentation, Tech Notes, 
  713. MPW command descriptions and Resource information.  In addition a facility for automatic 
  714. insertion of Toolbox call templates is provided.
  715.  
  716. “411” can also be customized and extended and new information can be added.  The help 
  717. files of “411” may be either local or on a shared file server.
  718.  
  719. Setting up “411”
  720.  
  721. “411” consists of a installation instructions file (Read Me First), a special UserStartup 
  722. script (UserStartup•Help), an installation script (Install411), and a set of help files 
  723. along with their .index files. It makes use of a new MPW tool, Get, which was written to 
  724. support “411” but can be used independently.  The “411” folder holds the help files, their 
  725. index files and a “Tools” folder.  
  726.  
  727. An important decision to make in setting up “411” is whether to place the “411” Help files 
  728. on a server or on your local hard disk.  Since these files are large (over 9 Meg total) some 
  729. thought should go into deciding which files to use and whether to transfer them to your 
  730. hard disk or, if you are connected to a network, to a file server.  The most obvious candi-
  731. date for removal is either CIncludesHelp or PInterfacesHelp.  If you are not developing in 
  732. both C and Pascal, one of them will probably not be needed. Placing the help files on a 
  733. local hard disk will provide better access speed but will use significant disk space.  If you 
  734. have access to a file server and several persons want to access “411” Help, it may be best 
  735. to move the “411” folder to the file server.
  736.  
  737. Set up “411” by writing the following two commands to your MPW WorkSheet and 
  738. executing them:
  739.  
  740. <rls>:Install411 <info>
  741. Execute "{ShellDirectory}"UserStartup•Help
  742.  
  743. where <rls> denotes the path to the “411” files on the release medium and <info> denotes 
  744. the volume on which the user wishes the “411” Help files to reside.  If <info> is omitted, 
  745. the installation will be to the volume that begins the path <rls>.  (In this latter case, the 
  746. data files are not duplicated because they are already residing in the desired place.)
  747. For example, if “411” were to be released in a folder named 411Stuff on a CD named MPW 
  748. 3.2 Release, and the user wanted “411” to be installed on a volume named HelpMe, then 
  749. the commands to be executed would read:
  750.  
  751. 'MPW 3.2 Release:411Stuff:Install411' HelpMe:
  752. Execute "{ShellDirectory}"UserStartup•Help
  753.  
  754. The effect of the first of the above commands is to create the folder HelpMe:411: and to 
  755. copy to it all of the “411” files.  It then, additionally, copies the new Get tool to the user’s 
  756. MPW Tools folder, copies UserStartup•Help to the MPW folder, and creates a folder 
  757. called Help Folder in the MPW folder.  This latter folder contains at this time a file called 
  758. Help_Folder whose contents is the single line: HelpMe:411:, i.e. the name of the folder 
  759. containing the “411” information.  The effect of the second of the above commands is to 
  760. add the “411” menu to the menu bar, and to add one more file to the Help Folder,  a file 
  761. called Help_Files which  contains the names of all of the “411” data files in the order in 
  762. which they will be interrogated, e.g.:
  763.  
  764. HelpMe:411:CIncludesHelp
  765. HelpMe:411:InsideMacintoshHelp
  766. HelpMe:411:MPWHelp
  767. HelpMe:411:PInterfacesHelp
  768. HelpMe:411:ResourcesHelp
  769. HelpMe:411:TechNotesHelp
  770.  
  771.  
  772. Using the “411” Help menu
  773.  
  774. “411” works only from within the MPW development environment.  When “411” is prop-
  775. erly set up, there should be a 411 menu on the MPW menu bar.  If there has been no 
  776. change to the UserStartup•Help script, the Help menu looks like this:
  777.  
  778.  
  779.  411 Menu
  780.     
  781.        Build   Format   Directory  411                   
  782.        ________________________________________________
  783.           HD:MPW:Worksheet       |  Contents          |
  784.        __________________________|  Look up    CMD-E  |
  785.                                  |  Template   CMD-1  |
  786.                                  |  Show Keys         |
  787.                                  |  Search            |
  788.                                  |____________________|
  789.                                  |  Set First File ...|
  790.                                  |   Set 411 Files ...|
  791.                                  |  Edit 411 Files ...|
  792.                                  |____________________|
  793.                                  |  About 411 ...     |
  794.                                  |____________________|
  795.  
  796. The menu items Look up and Template search all of the files listed in Help_Files; 
  797. the items Contents, Show Keys, and Search look only at the first file in the 
  798. Help_Files list.  This first file is known as the currently selected file.  It can be changed 
  799. by using the Set First File menu item.
  800.  
  801.  
  802. Contents
  803.  
  804. This menu item lets you see a list of the Help file’s table of contents.  For example, if the 
  805. CIncludesHelp file is the currently selected Help file, then selecting the “Contents” menu 
  806. item, causes a list of the ToolBox managers to appear in the Help window.
  807. ————————————————————————————————————————————————————————————————————————
  808. HelpMe:411:CIncludesHelp           Look up… "Help" 
  809. ————————————————————————————————————————————————————————————————————————
  810. Appletalk.h       FixMath.h         Palettes.h     Serial.h
  811. Controls.h        Fonts.h           Perf.h         ShutDown.h
  812. CursorCtl.h       Globals           Picker.h       Slots.h
  813. Desk.h            Graf3D.h          Printing.h     Sound.h
  814. Deskbus.h         HyperXCmd.h       Quickdraw.h    Start.h
  815. ...
  816.  
  817. Note that you can obtain the same information by selecting the key word "Help" (or the 
  818. name of the help file, e.g. CIncludesHelp) and then selecting the Look up menu item.  
  819.  
  820.  
  821. Look up  (Command-E)
  822.  
  823. This menu item lets you look up information stored in the help files; the search starts with 
  824. the currently selected file (See Set First File...).   For example, if you choose (see 2 
  825. below) the word FindWindow and then select the Look up menu item (or type Command-E) the 
  826. following information will appear in the Help window:
  827.  
  828. ------------------------------------------------------------------------
  829. HelpMe:411:CIncludesHelp     Look up… "findwindow" 
  830. ------------------------------------------------------------------------
  831. short findwindow(Point *thePoint,WindowPtr *theWindow);
  832. Type: Function
  833. File {CIncludes}Windows.h
  834. Trap Number A92C
  835. InsideMacintosh Reference: FindWindow function I-287, P-35, 114, 170 
  836. FindWindow procedure  V-208
  837. [Macintosh Plus, Macintosh SE, Macintosh II]
  838.  
  839. When a mouse-down event occurs, the application should call FindWindow 
  840. with thePt equal to the point where the mouse button was pressed (in 
  841. global coordinates, as
  842. ...
  843. Thus, to get help for a given key word:
  844.  
  845. 1) Choose the Help file you want information from by using the Set First File... menu 
  846. item to make the desired file the first file (currently selected file) in the help file list.  
  847. (Skip this step if the help file is already selected, or if the order of search does not 
  848. matter.)
  849.  
  850. 2) Click on a word in the active window.  You may want to type in the word you want to 
  851. look up instead.  If the item is just one word, it will be automatically selected if the 
  852. insertion point is adjacent to or within the word.  Only if a multiple word item is to be 
  853. looked up is it necessary to do a manual selection of the entire item.  (Note:  the means 
  854. you don’t have to double-click.  Also you don’t have to type the entire word, just 
  855. enough letters to allow 411 to distinguish between the word you want and any other in 
  856. the current Help file.)  
  857.  
  858. 3) Select the menu item Look up or type Command-E.  This triggers a search through the help 
  859. files, in the order in which they are listed,  looking for the selected key word.  If the 
  860. search is successful then a window named Help (a file in the MPW directory) is opened 
  861. and the information associated with the key word is displayed, along with an indication 
  862. of the file in which the key word was found.
  863.  
  864. Remember, the Look up menu item simply looks for the current selection in the active 
  865. window.
  866.  
  867. Since numbers are keywords only in TechNotesHelp, selecting a number will retrieve the 
  868. Macintosh Technical note of that number.
  869.  
  870. The header, which is placed above the “Contents” information, shows the help file that was 
  871. used.  To the right of the file name is a message indicating the key word on which the 
  872. search was made.  A mark is set to this (selected) key word in the file Help to aid the user 
  873. in subsequent scanning of Help for previously gathered information.  
  874.  
  875. A slight modification of UserStartup•Help causes the header to list all the “411” files in 
  876. the order in which they are searched, with  the words on the right (Look up…) printed on 
  877. the line bearing the name of the file in which the item was actually found.  (See 
  878. Customizing “411” below.)
  879.  
  880.  
  881. Template  (Command-1)
  882.  
  883. This menu item lets you replace a toolbox function call such as FindWindow with the 
  884. template for that function.  For example if you were to select “FindWindow” and choose 
  885. the 'Template' menu item (or type Command-1), then your "FindWindow" selection in the Active 
  886. window would be replaced by:
  887.  
  888. short myVariable = findwindow((Point *)thePoint,(WindowPtr *)theWindow);
  889.  
  890. Both C and Pascal templates are available.  Use Set First File... on the 411 menu to 
  891. choose a language by selecting either CIncludesHelp or PInterfacesHelp.
  892.  
  893.  
  894. Show keys…
  895.  
  896. This menu item lets you list all of the keys in the currently selected help file which begin 
  897. with the word you have selected in the Request dialog.  For example, selecting this menu 
  898. and then typing the two letters “fs” when CIncludesHelp is your current (first listed) help 
  899. file, produces a list of all of the HFS calls that begin with “FS”, i.e. FSClose, ...
  900.  
  901.  
  902. Search…
  903.  
  904. This menu item lets you search the currently selected help file for all occurrences of the 
  905. word you have selected.  The result is a list of names (keys) whose data records contain the 
  906. word.  On a large Help file, e.g. CIncludesHelp, this can take a minute or more.  Only the 
  907. current  (first listed) help file is searched even if no data record containing the word is 
  908. found.
  909.  
  910.  
  911. Set First File…
  912.  
  913. This menu item lets you choose a help file to be the currently selected file.  A dialog win-
  914. dow shows a list of all help files, and you are invited to make a selection.   The selected file 
  915. then becomes the first file in the list that appears in the file Help_Files.  It is then known 
  916. as the currently selected file, and, until you again reorder the list, is the initial target of all 
  917. Look up, Template, and Contents requests, and the only file used by Show 
  918. Keys and Search.   The Help window opens, displaying the contents list of the selected 
  919. file.  
  920.  
  921. Set 411 Files…
  922.  
  923. This menu item presents a standard file dialog from which to locate a help folder.  If a help 
  924. folder is selected then all the files in the folder that end in the word help are placed in the 
  925. list of files to search (in Help_Files).  Note that this will remove any existing files from 
  926. the list..
  927.  
  928.  
  929. Edit 411 Files
  930.  
  931. This menu item open the Help_Files window, which contains a list of all the help files 
  932. that “411” knows about.  The list may be edited and then saved.  Note that each line 
  933. specifies a path to a single help file.
  934.  
  935.  
  936. About 411…
  937.  
  938. This menu item displays the credits and then does a lookup in the MPWHelp file for the 
  939. key “About 411”.
  940.  
  941.  
  942. Customizing “411”
  943.  
  944. There are several ways in which “411” can be customized by modifying the 
  945. UserStartup•Help script:
  946.  
  947. •   If you are using a file server and want the script to call the MPW Choose tool to mount 
  948.     the file server when MPW is launched, set the script variables Help_Server and 
  949.     Guest. Set the former to the desired zone:server:volume pathname, and set the 
  950.     latter to 1 if want to log onto the server as an AppleShare “guest.”.  Note:  This requires 
  951.     the Choose tool from MPW 3.2 or later.
  952.  
  953. •   If you wish to add or change command keys in the menu, simply edit the AddMenu 
  954.     commands in the UserStartup•Help script. For example, the line
  955.  
  956.     AddMenu 411 "Look up/1" 
  957.  
  958.     in the script could be changed to:
  959.  
  960.     AddMenu 411 "Look up/7" 
  961.  
  962.     to change the function key to Command-7.  Alternatively,
  963.  
  964.     AddMenu 411 "Look up" 
  965.     removes the function key associated with the Look up menu item entirely.
  966.  
  967. •   If you wish to change the name of the “411” menu, modify the argument of the AddMenu 
  968.     command.  For example, you can change the menu name “411” to “MyMenu” by 
  969.     changing all occurrences of AddMenu 411... to AddMenu MyMenu... in the 
  970.     UserStartup•Help script.
  971.  
  972. •   If you wish all help files to be listed in the header, change the script so that it sets the 
  973.     value of the variable headerStyle to -h (the default is -h2).
  974.  
  975.  
  976. Using the Get Tool
  977.  
  978. The retrieval of information through the “411” Help menu is based upon calls to the MPW 
  979. Get tool.  The calls that are used by “411” can be seen in the file UserStartup•Help.  If 
  980. you choose, you may instead call the Get tool directly or from your own script.  
  981.  
  982. (See the section on Get in the MPW 3.2 B1 Tools/Scripts Release Notes.)  
  983.  
  984.  
  985. Adding your own help to “411”
  986.  
  987. Help files used by the Get tool are ordinary MPW Shell document files whose names end 
  988. with “Help” and that have an internal organization which is recognized by the Get tool.  
  989. The requirements are that a Help file consists of a set of records, each record in turn con-
  990. sisting of one or more fields.  Each record must start with the field tag æKY (“æ” is option-')  
  991. followed by one or more words separated by carriage returns.  The search of the help file is 
  992. made on the key words.  All other fields are various categories of information to be re-
  993. trieved.  Field tags must be the first item on a line, and are separated from the following 
  994. material by one or more spaces.  Field tags are case sensitive.  Each field is terminated by 
  995. the appearance of a new field tag.  The record is terminated by the next æKY tag (or end of 
  996. file).
  997.  
  998. Example:
  999.  
  1000.  
  1001.  æKY Key1
  1002.      Key2
  1003.      Key3
  1004.  æC This is a comment
  1005.  
  1006. The various tags other than æKY are used to put the information to be retrieved into cate-
  1007. gories.  The most neutral of them is æC, which is used for general textual matter.  These 
  1008. tags in some cases modify the behavior of Get.  For example, the tag æDT, which is used 
  1009. for templates, precedes data which will be retrieved if and only if Get is called with the -t 
  1010. option.  This is used in the implementation of the “template” menu item.  Other tags cause 
  1011. some boiler plate to be emitted prior to the text in the data base.  For example, the tag æRI is 
  1012. used for fields that contain chapter and page references to Inside Macintosh.  The text 
  1013. following the field tag will have inserted before it the cosmetic text:  “InsideMacintosh 
  1014. Reference:”.  
  1015.  
  1016. Field Tag Codes:
  1017.  
  1018.  æKY     Key word or set of key words separated by carriage returns.  This field denotes
  1019.          the beginning of  a “411” record and the words in this field are the record's
  1020.          names, i.e. the words used as keys for retrieval of the record’s data.
  1021.  
  1022.  æKL     Key word List .  This is typically used in conjunction with the key “Help” to
  1023.          list, as a table of contents, all of the key words in the file.
  1024.  
  1025.  æFa     File name of Assembler include file.
  1026.  
  1027.  æFc     File name of C header file.
  1028.  
  1029.  æFp     File name of Pascal Interface file.
  1030.  
  1031.  æF      Used for the names of files which are not interfaces.
  1032.  
  1033.  æT      Type of the item:  function/structure/constant/etc. 
  1034.  
  1035.  æD      Formal declaration of the item: function, procedure, or structure. 
  1036.  
  1037.  æDT     A template for calls of procedures and functions.
  1038.  
  1039.  æC      Commentary.  This is general textual information, generally lengthy compared
  1040.         to that associated with the other tags.
  1041.  
  1042.  æR      Reference to…  Used for references other than to Tech Notes and Inside
  1043.         Macintosh.
  1044.  
  1045.  æRI     Reference to Inside Macintosh.  This is usually a chapter and page reference.
  1046.  
  1047.  æRT     Reference to Tech Note.  This is usually a reference by number.
  1048.  
  1049.  æTN     Trap Number.  This is used to annotate function that are in-line trap calls.
  1050.  
  1051.  æMM     Routine may move or purge memory.  This tag cause issuance of the preceding
  1052.         warning.
  1053.  
  1054.  
  1055. When the Get tool is executed, it first retrieves the byte offset of a key word from the index 
  1056. file, positions to the æKY line in the help file, and then reads all of the following lines until 
  1057. another æKY typed line is encountered.  Get then outputs the record, after first removing 
  1058. the field tag codes from each field.  Therefore, if the contents of a help file are altered in 
  1059. any way, it is necessary that the index be rebuilt.  This is handled automatically by the Get 
  1060. tool, which puts up a dialog stating that the index needs to be rebuilt and requesting 
  1061. permission.  In ordinary circumstances, this dialog should be answered affirmatively.
  1062.  
  1063.  
  1064. About the files in your “411” folder
  1065.  
  1066. The "411" folder contains the following files:
  1067. :411:
  1068.        Install411                   # the "411 installation script.
  1069.        CIncludesHelp                # the CIncludesHelp data file. 
  1070.        CIncludesHelp.index          # the CIncludesHelp index file. 
  1071.        InsideMacintoshHelp          # Vols. 1-5 data file.
  1072.        InsideMacintoshHelp.index    # Vols. 1-5 index file.
  1073.        MPWHelp                      # the MPWHelp data file.
  1074.        MPWHelp.index                # the MPWHelp index file.
  1075.        PInterfacesHelp              # the PInterfacesHelp data file.
  1076.        PInterfacesHelp.index        # the PInterfacesHelp index file.
  1077.        ResourcesHelp                # the ResourcesHelp data file.
  1078.        ResourcesHelp.index          # the ResourcesHelp index file.
  1079.        TechNotesHelp                # the TechNotesHelp data file.
  1080.        TechNotesHelp.index          # the TechNotesHelp index file.
  1081.                           
  1082.  
  1083. :411:Tools:
  1084.        Get                          # the Get MPW tool - used to
  1085.                                     # look up help info.
  1086.        UserStartup•Help             # the "411" UserStartup script.
  1087.  
  1088.  
  1089. Files created by “411”
  1090.  
  1091. The following files are created by the UserStartup•Help script, either at startup time, or 
  1092. as the result of execution of menu items created by the script.  They all reside in the folder 
  1093. "{MPW}Help Folder:"
  1094.  
  1095.  
  1096.  
  1097.          Help                      # your "411" Help window.
  1098.          Help_Folder               # contains the "411" path name 
  1099.                                    # (path name to help data and 
  1100.                                    # index files) 
  1101.          Help_Files                # contains the list of all help  
  1102.                                    # files (full file names including path)
  1103.          Help_Temp                # temporary file used by the "411" menu
  1104.  
  1105.  
  1106.  
  1107. æKY AddPane
  1108. æC                         AddPane-- split the window into panes
  1109.  
  1110. AddPane[-p paneSpec] [-h ySplit | -v xSplit] [window]
  1111.      -p paneSpec           # choose a pane to split
  1112.      -h ySplit             # horizontal split at ySplit pixels from top
  1113.      -v xSplit             # vertical split at xSplit pixels from left
  1114.  
  1115.       Note: paneSpec is an alternating catenation of strings of the 
  1116.       form cm and rn, where m is a column ordinal and n is a row ordinal.
  1117.  
  1118.  
  1119.  
  1120. æKY AddMenu
  1121. æC                      AddMenu -- add a menu item
  1122.  
  1123. AddMenu [menu [item [command…]]]  > menuList
  1124.  
  1125. Status codes returned:
  1126.   0    No errors.
  1127.   1    Syntax error.
  1128.   2    An item can’t be redefined.
  1129.   3    System error.
  1130.  
  1131.                            Description
  1132.  
  1133.   Associates a list of commands with the menu item itemName in the
  1134.   menu menuName. If the menu menuName already exists, the new item
  1135.   is appended to the bottom of that menu. If the menu menuName doesn’t
  1136.   already exist, a new menu is appended to the menu bar, and the new
  1137.   item is appended to that menu. When the new menu item is selected,
  1138.   its associated command list is executed just as though the command
  1139.   text had been selected and executed in the active window.
  1140.  
  1141.     • Note: The command text that you specify for an AddMenu item
  1142.     is processed twice—once when you execute the AddMenu command
  1143.     itself, and again whenever you subsequently select the new menu
  1144.     item. This means that you must be careful to quote items so that
  1145.     they are processed at the proper time. See the “Examples” section
  1146.     below.
  1147.  
  1148.   You can also use AddMenu to display information for existing user-defined
  1149.   menus by omitting parameters:
  1150.  
  1151.     • If command is not specified, the command list associated with
  1152.     itemName is written to standard output.
  1153.  
  1154.     • If itemName and command are both omitted, a list of all user-defined
  1155.     items for menuName is written to standard output.
  1156.  
  1157.     • If no parameters are specified, a list of all user-defined
  1158.     items is written to standard output.
  1159.  
  1160.   (This output is in the form of AddMenu commands.)
  1161.  
  1162.   You can also use AddMenu to change the command list or markings associated
  1163.   with a particular itemName. If both menuName and itemName already
  1164.   exist, the command list associated with itemName will be changed
  1165.   to command. Also, any marking or styles associated with itemName
  1166.   will be changed. The position of itemName in menuName will not be
  1167.   affected.
  1168.  
  1169.   You can define keyboard equivalents, character styles, and other
  1170.   features for your new menu commands—itemName can contain any of the
  1171.   metacharacters that are used with the AppendMenu( ) procedure documented
  1172.   in the MPW chapter entitled “Menu Manager” of Inside Macintosh:
  1173.  
  1174.   /char        Assign the keyboard equivalent Command-char.
  1175.  
  1176.   !char        Place char to the left of the menu item.
  1177.  
  1178.   ^n           Item has an icon, where n is the icon number. See Inside 
  1179.                Macintosh.
  1180.  
  1181.   (            Item is disabled (dimmed).
  1182.  
  1183.   <style       Item has a special character style; this style can be any
  1184.                of the following capital letters:
  1185.  
  1186.                B Bold
  1187.  
  1188.                I Italic
  1189.  
  1190.                U Underline
  1191.  
  1192.                O Outline
  1193.  
  1194.                S Shadow
  1195.  
  1196.   Multiple styles may be specified by preceding each with “<”. Be sure
  1197.   to quote menu items containing these special characters. (See the
  1198.   “Examples” section below.)
  1199.  
  1200.     • Note: Semicolons ( ; ) cannot be used within an itemName.
  1201.  
  1202.   Menu items can’t be appended to the Window, Mark, or Apple menus.
  1203.  
  1204.  
  1205.                             Examples
  1206.  
  1207.   AddMenu
  1208.  
  1209.   Lists all user-defined menu items.
  1210.  
  1211.   AddMenu Extras “TimeStamp//P” 'Echo `Date`'
  1212.  
  1213.   Adds an “Extras” menu with a “TimeStamp” item, which writes the current
  1214.   time and date to the active window. This item has the Command-key
  1215.   equivalent Command-P.
  1216.  
  1217.   AddMenu File 'Format<B' 'Erase 1'
  1218.  
  1219.   Adds a “Format” item to the File menu (as discussed under the Erase
  1220.   command) and makes the item bold.
  1221.  
  1222.   AddMenu Find Top 'Find • “{Active}”'
  1223.  
  1224.   Adds the menu item “Top” to the Find menu, and defines it as the
  1225.   Find command enclosed in single quotation marks. This command places
  1226.   the insertion point at the beginning of the active window.
  1227.  
  1228.   Note: The following attempt to do the same thing will not work:
  1229.  
  1230.   AddMenu Find Top “Find • {Active}”
  1231.  
  1232.   This command won’t work because the {Active} variable will be expanded
  1233.   when the menu is added. (It should be expanded when the menu item
  1234.   is executed.) In the first (correct) example, the single quotes defeat
  1235.   variable expansion when the AddMenu command is executed; they are
  1236.   then stripped before the item is actually added. The double quotation
  1237.   marks remain, in case the pathname of the active window happens to
  1238.   contain any special characters.
  1239.  
  1240.   You may want to add some or all of the following commands to your
  1241.   UserStartup file:
  1242.  
  1243.   AddMenu Find '(-' ''
  1244.  
  1245.   AddMenu Find 'Top/6' 'Find • “{Active}”'
  1246.  
  1247.   AddMenu Find 'Bottom/5' 'Find ∞ “{Active}”'
  1248.  
  1249.   These commands create several new items in the Find menu. The first
  1250.   is a disabled separator that creates a new section at the bottom
  1251.   of the menu. The Top and Bottom items position the insertion point
  1252.   at the top and bottom of the active window. Both menu items have
  1253.   Command-key equivalents.
  1254.  
  1255.   AddMenu Directory 'Work' 'Directory HD:MPW:Work'
  1256.  
  1257.   AddMenu Directory 'Work!•' 'Directory HD:MPW:Work'
  1258.  
  1259.   The first command creates a command to move to the directory HD:MPW:Work.
  1260.   The second command marks the Work item with a bullet without changing
  1261.   the position of the item in the menu.
  1262.  
  1263.                             See also 
  1264.  
  1265.    DeleteMenu command.
  1266.  
  1267.   “Quoting Special Characters,” “How Commands Are Interpreted,” and
  1268.   “Defining Your Own Menu Commands” in Chapter 5.
  1269.  
  1270.   “Creating a Menu in Your Program” in chapter “Menu Manager” of Inside
  1271.   Macintosh.
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277. æKY Adjust
  1278. æC                        Adjust -- adjust lines
  1279.  
  1280. Adjust [-c count] [-l spaces] selection [window]
  1281.  
  1282.  -c count                # repeat the Adjust count times
  1283.  -l spaces               # shift lines by “spaces” spaces
  1284.  
  1285. Status codes returned:
  1286.   0    At least one instance of the selection was found.
  1287.   1    Syntax error.
  1288.   2    Another error.
  1289.  
  1290.                            Description
  1291.  
  1292.   Finds and selects the given selection and shifts all lines within
  1293.   the selection to the right by one tab, without changing the indentation.
  1294.  
  1295.   If a count is specified, count instances of selection are affected.
  1296.   The -l option lets you move lines by any number of spaces to the
  1297.   left or right.
  1298.  
  1299.   If you specify the window parameter, the command operates on window.
  1300.   It’s an error to specify a window that doesn’t exist. If no window
  1301.   is specified, the command operates on the target window (the second
  1302.   window from the front).
  1303.  
  1304.  
  1305.                             Examples
  1306.  
  1307.   Adjust -l 4 §
  1308.  
  1309.   Shifts the lines containing the target selection to the right by
  1310.   four spaces.
  1311.  
  1312.   Adjust -l -8 /if/Δ:Δ/else/
  1313.  
  1314.   Selects everything after the next “if” and before the following “else”,
  1315.   and shifts all lines within the selection to the left by eight spaces.
  1316.  
  1317.                             See also 
  1318.  
  1319.   Align command.
  1320.   “Selections” in Chapter 6.
  1321.  
  1322. æKY Alert
  1323. æC                     Alert -- display an alert box
  1324.  
  1325. Alert [-s] [message…] < file
  1326.  -s                      # silent, don't beep when dialog is displayed
  1327.  
  1328. Status codes returned:
  1329.   0    No errors.
  1330.   1    Syntax error.
  1331.  
  1332.                            Description
  1333.  
  1334.   Displays an alert box containing the prompt message. The alert is
  1335.   displayed until its OK button is clicked. If the message contains
  1336.   any special characters, you’ll need to quote it.
  1337.  
  1338.  
  1339.                             Examples
  1340.  
  1341.   Alert Please insert next disk to be searched.
  1342.  
  1343.   Displays the following alert box and waits for the user to click
  1344.   “OK” before returning.
  1345.  
  1346.                             Also see
  1347.  
  1348.  Confirm and Request commands.
  1349. æKY Alias
  1350. æC               Alias  -- define or write command aliases
  1351.  
  1352. Alias [name [word…]]  > aliasList
  1353.  
  1354. Status codes returned:
  1355.   0    No errors.
  1356.   1    The specified alias could not be found.
  1357.  
  1358.                            Description
  1359.  
  1360.   Name becomes an alias for the list of words. Subsequently, when name
  1361.   is used as a command name, word… will be substituted in its place.
  1362.  
  1363.   If only name is specified, any alias definition associated with name
  1364.   is written to standard output. If name and word are both omitted,
  1365.   a list of all aliases and their values is written to standard output.
  1366.   (This output is in the form of Alias commands.)
  1367.  
  1368.   Aliases are local to the script in which they are defined. An initial
  1369.   list of aliases is inherited from the enclosing script. Inherited
  1370.   aliases may be overridden locally. You can make an alias definition
  1371.   available to all scripts by placing the definition in the UserStartup
  1372.   file.
  1373.  
  1374.   You can remove aliases with the Unalias command.
  1375.  
  1376.  
  1377.                              Examples
  1378.  
  1379.   Alias Dir Directory
  1380.  
  1381.   Creates an alias “Dir” for the Directory command.
  1382.  
  1383.   Alias Top 'Find •'
  1384.  
  1385.   Creates an alias “Top” for the command “Find •” (which places the
  1386.   insertion point at the beginning of a window). The command takes
  1387.   an optional window parameter and by default acts on the target window.
  1388.   The Top command could now be used as follows:
  1389.  
  1390.   Top # find top of target window
  1391.  
  1392.   Top Sample.a # find top of window Sample.a
  1393.  
  1394.   # (equivalent to “Find • Sample.a”)
  1395.  
  1396.                             See also
  1397.  
  1398.   Unalias command.
  1399.   “Command Aliases” in Chapter 5.
  1400.  
  1401. æKY Align
  1402. æC                 Align -- align text to left margin
  1403.  
  1404. Align [-c count] selection [window]
  1405.  -c count                # repeat the Align count times
  1406.  
  1407. Status codes returned:
  1408.   0    At least one instance of the selection was found.
  1409.   1    Syntax error.
  1410.   2    Any other error.
  1411.  
  1412.                            Description
  1413.  
  1414.   All lines within each instance of the selection are positioned to
  1415.   the same distance from the left margin as the first line in the selection.
  1416.  
  1417.   If you specify the window parameter, the Align command will act on
  1418.   window. It’s an error to specify a window that doesn’t exist. If
  1419.   no window is specified, the command operates on the target window
  1420.   (the second window from the front).
  1421.  
  1422.  
  1423.                              Examples
  1424.  
  1425.   Align §
  1426.  
  1427.   Same as the Align menu item; that is, it aligns all lines in the
  1428.   default selection with the first line of the selection.
  1429.  
  1430.   Align /Begin/:/End/
  1431.  
  1432.   Selects everything from the next “Begin” through the following “End”,
  1433.   and aligns all lines within the selection to the same margin position
  1434.   as the line that contains the “Begin”.
  1435.  
  1436.                              See Also
  1437.  
  1438.  Adjust command.
  1439.   “Selections” in Chapter 6.
  1440.  
  1441. æKY Asm
  1442. æC                    Asm -- MC68xxx Macro Assembler
  1443.  
  1444. Asm [option…] [file…]  < file > listing ≥ progress
  1445.  -addrsize size          # set size of address display
  1446.  -blksize blocks         # use blocks * 512 byte I/O buffers
  1447.  -case on                # distinguish between upper and lower case
  1448.  -case obj[ect]          # preserve case in object file
  1449.  -case off               # ignore case (default)
  1450.  -c[heck]                # syntax check only, don't create object file
  1451.  -d[efine] name          # equivalent to: name EQU 1
  1452.  -d[efine] name=value    # equivalent to: name EQU value
  1453.  -d[efine] &name         # equivalent to: &name SET[AC] 1
  1454.  -d[efine] &name=value   # equivalent to: &name SET[AC] value
  1455.  -e[rrlog] file          # write errors and warnings to file
  1456.  -f                      # suppress page ejects in listing
  1457.  -font name[,size]       # set listing font and size
  1458.  -h                      # suppress page headers in listing
  1459.  -i directory,…          # search for includes in directory,…
  1460.  -l                      # write full listing to output
  1461.  -lo file                # listing output file or directory
  1462.  -model far              # allow generation of load-time relocatable 32-bit references 
  1463.  -model near             # prohibit generation of load-time relocatable 32-bit
  1464.                          #    references (the default)
  1465.  -o objname              # generate code in file or directory objname
  1466.  -pagesize l[,w]         # set listing page length and width
  1467.  -print mode             # equivalent to: PRINT mode
  1468.  -p                      # write progress information to diagnostics
  1469.  -s                      # write short listing to output
  1470.  -sym off                # no SADE records
  1471.  -sym on|full            # full SADE records; can modify with [,nolines] 
  1472.                          # [,notypes] [,novars]
  1473.  -t                      # write time and total lines to diagnostics
  1474.  -w                      # suppress warnings
  1475.  -wb                     # suppress warnings on branch instructions
  1476.  
  1477. Status codes returned:
  1478.   0    No errors detected in any of the files assembled.
  1479.   1    Parameter or option errors.
  1480.   2    Errors detected.
  1481.  
  1482.                            Description
  1483.  
  1484.   Assembles the specified assembly-language source files. One or more
  1485.   filenames may be specified. If no filenames are specified, standard
  1486.   input is assembled and the file “a.o” is created. By convention,
  1487.   assembly-language source filenames end in the suffix “.a”. Each file
  1488.   is assembled separately—assembling file name.a creates object file
  1489.   name.a.o. The object filename can be changed with the -o option.
  1490.  
  1491.   See the MPW 3.0 Assembler Reference for more information about the
  1492.   assembly language. The first Commando dialog box for this command
  1493.   is reproduced here for convenience.
  1494.  
  1495.  
  1496.                              Examples
  1497.  
  1498.   Asm -w -l Sample.a Memory.a -d Debug
  1499.  
  1500.   Assembles Sample.a and Memory.a, producing object files Sample.a.o
  1501.   and Memory.a.o. Suppresses warnings and defines the name Debug as
  1502.   having the value 1. Two listing files are generated: Sample.a.lst
  1503.   and Memory.a.lst. (Sample.a and Memory.a are located in the AExamples
  1504.   directory.)
  1505.  
  1506.                             See Also
  1507.  
  1508.   MPW3.0 Assembler Reference.
  1509.  
  1510. æKY AsmCvtIIGS   
  1511. æC    AsmCvtIIGS -- converts APW Assembler source files to AsmIIGS format
  1512. AsmCvtIIGS [option…] <file> >listing ≥ progress
  1513.  -o <filename>           # write converted source to <filename>
  1514.  -p                      # write progress to diagnostic output
  1515.  -qe                     # add an "end" statement to the converted source
  1516.  -qr                     # make data and privdata segments records, rather than procs
  1517.  -w                      # warning messages are not displayed
  1518.  -i <filename>           # get definitions from the "include" file <filename>
  1519. æKY AsmIIGS
  1520. æC                   AsmIIGS -- the MPW IIGS Assembler
  1521. AsmIIGS [option…] [file…]  < file > listing ≥ progress
  1522.  -blksize blocks         # use blocks * 512 byte I/O buffers
  1523.  -case on                # distinguish between upper and lower case
  1524.  -case obj[ect]          # preserve case in object file
  1525.  -case off               # ignore case (default)
  1526.  -c[heck]                # syntax check only, don't create object file
  1527.  -d[efine] name          # equivalent to: name EQU 1
  1528.  -d[efine] name=value    # equivalent to: name EQU value
  1529.  -d[efine] &name         # equivalent to: &name SET[AC] 1
  1530.  -d[efine] &name=value   # equivalent to: &name SET[AC] value
  1531.  -f                      # suppress page ejects in listing
  1532.  -font name[,size]       # set listing font and size
  1533.  -h                      # suppress page headers in listing
  1534.  -i directory,…          # search for includes in directory,…
  1535.  -l                      # write full listing to output
  1536.  -lo file                # listing output file or directory
  1537.  -m                      # provide more target address information (l is also required)
  1538.  -o objname              # generate code in file or directory objname
  1539.  -pagesize l[,w]         # set listing page length and width
  1540.  -print mode             # equivalent to: PRINT mode
  1541.  -p                      # write progress information to diagnostics
  1542.  -s                      # write short listing to output
  1543.  -t                      # write time and total lines to diagnostics
  1544.  -w                      # suppress warnings
  1545. æKY AsmMatIIGS
  1546. æC                AsmMatIIGS -- Assembler source formatter
  1547. AsmMatIIGS [options...] SourceFile DestFile 
  1548.  -p               # write version information to diagnostic output
  1549.  -1 val           # column number that should contain the opcode (default 21)
  1550.  -2 val           # column number that should contain the operand (default 25)
  1551.  -3 val           # column number that should contain the comment (default 41)
  1552.  -t val           # number of spaces between tabs (default 20)
  1553.  -c val           # start column num for comments without semi-colons(default 35)
  1554. æKY Backup
  1555. æC                     Backup -- folder file backup
  1556.  
  1557. Backup [option…] -from folder -to folder [file…]  > commands ≥ progress
  1558.  -a                      # copy all files in "from" not in "to"
  1559.  -alt                    # alternate prompts for disk drives
  1560.  -c                      # create "to" folders if they don't exist
  1561.  -check checkopt,…       # produce reports based on checkopt
  1562.                          # checkopt=from     "from" not in "to"
  1563.                          #          to       "to" not in "from"
  1564.                          #          allfroms "from" not in "to" even if none
  1565.                          #          alltos   "to" not in "from" even if none
  1566.                          #          folders  "from" folders not in "to"
  1567.                          #          newer    "to"s newer than "from"s
  1568.  -co filename            # redirect -check reports to filename
  1569.  -compare [only][,'opts']# write compare commands for out-of-date files
  1570.  -d                      # write delete commands for files in "to" not in "from"
  1571.  -do [only][,'command']  # write the command string specified by command…
  1572.  -e                      # eject disk when done
  1573.  -from folder|drive      # specify source folder or drive (1 or 2)
  1574.  -l                      # write directory listing of "from" files
  1575.  -lastcmd 'command'      # write the command string as the last command
  1576.  -level n                # restrict -a and -d to files beyond level n
  1577.  -m                      # multi-disk -- more than one "from" or "to" disk
  1578.  -n                      # show folder nesting by indenting commands 
  1579.  -p                      # write progress information to diagnostics
  1580.  -r                      # recursively process nested folders
  1581.  -revert                 # revert "to" files to their "from" state
  1582.  -since date[,time]|fname# process only files since specified time
  1583.  -sync                   # synchronize both source and destination folders
  1584.  -t type                 # process only files of specified type
  1585.  -to folder|drive        # specify destination folder or drive (1 or 2)
  1586.  -y                      # suppress duplicate -y option
  1587.  
  1588. Status codes returned:
  1589.   0    No errors; Shell duplicate commands have been generated or filenames were     listed.
  1590.   1    Parameter or option errors.
  1591.   3    No errors and no files to duplicate or list.
  1592.   Note:  Backup returns a status code of 3 when no files need copying. 
  1593.        If no files are copied because none of the files in the source folder 
  1594.        exists in the destination folder, Backup also reports a warning to 
  1595.        the diagnostic output file. If there are no name matches, it is 
  1596.        possible that your from/to pathnames were specified incorrectly. 
  1597.        Hence, Backup lets you know of the possible error. Backup does not 
  1598.        report this as an error if you use the  -l, -a, or -since option.
  1599.  
  1600.                            Description
  1601.  
  1602.   Files in a source (“from”) folder are copied to a destination (“to”)
  1603.   folder based on the modification date. By default, only files that
  1604.   already exist in both the source and destination folders are candidates
  1605.   for copying. (The -a option can override this default.) Backup does
  1606.   not actually make the copies. Instead, it generates a script of MPW
  1607.   Shell duplicate commands.
  1608.  
  1609.   Backup’s default operation is based on the premise that you already
  1610.   have an existing folder on two sets of disks (generally a hard disk
  1611.   and a set of 3.5-inch disks—drive numbers may be specified as folder
  1612.   “names”) and that you want to make sure that the files on one of
  1613.   the disks are the same as the files on the other disk. Thus, it is
  1614.   the files on the destination (“to”) disk that determine which files
  1615.   can be copied from the source (“from”) disk.
  1616.  
  1617.   A Shell duplicate command is generated to the standard output file
  1618.   if
  1619.  
  1620.     • a file on a source disk also exists on the destination disk,
  1621.     and
  1622.  
  1623.     • the modification date of the source is newer than that of the
  1624.     destination.
  1625.  
  1626.   In addition to the basic function of generating Shell duplicate commands,
  1627.   Backup also provides these services:
  1628.  
  1629.     • Folders can be recursively processed, allowing processing of
  1630.     all folders and subfolders contained within folders (-r).
  1631.  
  1632.     • Compare commands can be generated for out-of-date files of
  1633.     type TEXT to discover why the files are different (-compare).
  1634.  
  1635.     • Filenames that exist on one disk and not on the other can be
  1636.     displayed
  1637.  
  1638.   (-check from,to).
  1639.  
  1640.     • File folder names that don’t exist on the destination can be
  1641.     displayed
  1642.  
  1643.   (-check folders).
  1644.  
  1645.     • Filenames in the destination that are newer than the source
  1646.     can be displayed
  1647.  
  1648.   (-check newer).
  1649.  
  1650.  
  1651.                              Examples
  1652.  
  1653.   backup  -from :HDfolder:  -e
  1654.  
  1655.   Check that all files on the disk in drive 1 (-to is omitted, so “-to
  1656.   1” is implied) are up to date with respect to the files in :HDfolder:.
  1657.   If they are, the disk in drive 1 is ejected. If not, the appropriate
  1658.   Duplicate commands are generated to update the out-of-date files
  1659.   on the disk in drive 1. An Eject 1 command is generated to eject
  1660.   the disk after the Duplicate commands are processed.
  1661.  
  1662.   backup  -r  -from FServer:MPW:  -to HD:MPW:  -check folders
  1663.  
  1664.   Recursively process (-r) all the files in all the folders on FServer:MPW:
  1665.   to make sure that the files on HD:MPW: are up-to-date. Appropriate
  1666.   Duplicate commands are generated to copy the out-of-date files from
  1667.   the folders in FServer:MPW: to the folders in HD:MPW:. It is assumed
  1668.   that the folder names in HD:MPW: are the same as the folder names
  1669.   in FServer:MPW:. Any folders in FServer:MPW: that don’t exist in
  1670.   HD:MPW are skipped. Because the -check option is specified, a list
  1671.   of all the skipped folders is written to the diagnostic file.
  1672.  
  1673.   Limitations Multi-disk operation (-m) is not supported with recursion
  1674.   (-r).
  1675.  
  1676.   The -e option is ignored when -m is specified.
  1677.  
  1678.   Only drive numbers 1 and 2 are supported, and they are assumed to
  1679.   be ejectable 3.5-inch disk drives.
  1680.  
  1681. æKY Beep
  1682. æC                       Beep -- generate tones
  1683.  
  1684. Beep [note [,duration [,level]]]…
  1685.  #   duration is given in sixtieths of a second (default is 15)
  1686.  #   sound level is given as a number from 0 to 255 (default is 128)
  1687.  
  1688. Status code returned:
  1689.    0    no errors.
  1690.  
  1691.  
  1692.                            Description
  1693.  
  1694.   For each parameter, Beep produces the given note for the specified
  1695.   duration and sound level on the Macintosh speaker. If no parameters
  1696.   are given, a simple beep is produced.
  1697.  
  1698.   Note is one of the following:
  1699.  
  1700.     • A number indicating the count field for the square wave generator,
  1701.     as described in chapter “Summary of the Sound Driver” of Inside
  1702.     Macintosh.
  1703.  
  1704.     • A string in the following format:
  1705.  
  1706.   [ n ] letter [ # | b ]
  1707.  
  1708.   n is an optional number between –3 and 3 indicating the octaves below
  1709.   or above middle C, followed by a letter indicating the note (A–G)
  1710.   and an optional sharp (#) or flat (b) sign. Note that any sharps
  1711.   (#) must be enclosed in quotation marks—otherwise they will be interpreted
  1712.   as comment delimiters.
  1713.  
  1714.   The optional duration is given in sixtieths of a second. The default
  1715.   duration is 15 (one-quarter second).
  1716.  
  1717.   The optional sound level is given as a number from 0 to 255. The
  1718.   default level is 128.
  1719.  
  1720.  
  1721.                              Examples
  1722.  
  1723.   Beep
  1724.  
  1725.   Produce a simple beep on the speaker.
  1726.  
  1727.   Beep 2C,20 '2C#,40' 2D,60
  1728.  
  1729.   Play the three notes specified: C , C sharp, and D—all two octaves
  1730.   above middle C—for one-third, two-thirds, and one full second, respectively.
  1731.   Notice that the second parameter must be quoted; otherwise the sharp
  1732.   character (#) would indicate a comment.
  1733.  
  1734. æKY Begin
  1735. æC                      Begin  -- group commands
  1736.  
  1737. Begin
  1738.  command…
  1739. End
  1740.  
  1741. The status code of the last command executed is returned. 
  1742. (If no commands appear between Begin and End, 0 is returned.)
  1743.  
  1744.                            Description
  1745.  
  1746.   Groups commands for pipe specifications, conditional execution, and
  1747.   input/output specifications. Carriage returns must appear at the
  1748.   end of each line as shown above, or be replaced with semicolons (
  1749.   ; ). If the pipe symbol (|), conditional execution operators (&&
  1750.   and ||), or input/output specifications (<, >, >>, ≥, ≥≥, ∑, ∑∑)
  1751.   are used, the operator must appear after the End command and applies
  1752.   to all of the enclosed commands.
  1753.  
  1754.     • Note: Begin and End behave like left and right parentheses.
  1755.     Once the Begin command has been executed, the Shell will not
  1756.     execute any of the subsequent commands until it encounters the
  1757.     End command, so that input/output specifications can be processed.
  1758.  
  1759.  
  1760.                              Examples
  1761.  
  1762.   The following commands save the current variables, exports, aliases,
  1763.   and menus in the file SavedState.
  1764.  
  1765.   Begin
  1766.     Set
  1767.     Export
  1768.     Alias
  1769.     AddMenu
  1770.   End > SavedState
  1771.  
  1772.   Notice that the output specification following “End” applies to all
  1773.   of the commands within the Begin…End control command. This command
  1774.   is identical to the following:
  1775.  
  1776.   (Set; Export; Alias; AddMenu) > SavedState
  1777.  
  1778.   The commands Set, Export, Alias, and AddMenu write their output in
  1779.   the form of commands; these commands can be executed to redefine
  1780.   variables, exports, aliases, and menus, respectively. Therefore,
  1781.   after executing the above commands, the command
  1782.  
  1783.   Execute SavedState
  1784.  
  1785.   will restore all of these definitions. You must “execute” the script
  1786.   so that the variables and aliases are applied to the current scope.
  1787.  
  1788.     • Note: This technique is used in the Suspend script to save
  1789.     state information. (You might want to take a look at Suspend,
  1790.     which also saves the list of open windows and the current directory.)
  1791.     The Resume file runs the file that Suspend creates, restoring
  1792.     the various definitions, reopening the windows, and resetting
  1793.     the current directory.
  1794.  
  1795. æKY Break
  1796. æC                   Break -- break from For or Loop
  1797.  
  1798. Break [If expression]
  1799.  
  1800. Status codes returned:
  1801.   0    No errors detected.
  1802.   –3   Break is found outside a For…End or Loop…End, or the parameters
  1803.        to Break are incorrect.
  1804.   –5   Invalid expression.
  1805.  
  1806.                            Description
  1807.  
  1808.   If expression is nonzero, Break terminates execution of the immediately
  1809.   enclosing For or Loop command. (Null strings are considered zero.)
  1810.   If the “If expression” is omitted, the break is unconditional. (For
  1811.   a definition of expression, see the Evaluate command.)
  1812.  
  1813.  
  1814.                              Examples
  1815.  
  1816.   Set Exit 0
  1817.   For file in Startup UserStartup Suspend Resume Quit
  1818.     EnTab “{file}” > temp
  1819.     Break If {Status} != 0
  1820.     Rename -y temp “{file}”
  1821.     Print -h “{file}”
  1822.     Echo “{file}”
  1823.   End
  1824.  
  1825.   This For loop entabs and prints each of the special MPW scripts;
  1826.   the Break command terminates the loop if a nonzero status value is
  1827.   returned. (See the For command for further explanation of this example.)
  1828.  
  1829.   Set loopcount |
  1830.     Loop
  1831.     Break if {loopcount} > 10
  1832.     Echo “Loop Number {loopcount}”
  1833.     Evaluate loopcount +=1
  1834.   End
  1835.  
  1836.   This example loops until the variable {loopcount} is greater than
  1837.   10. Use of the Evaluate command is also demonstrated.
  1838.  
  1839.  
  1840.                              See also 
  1841.  
  1842.   For, Loop, and If commands.
  1843.  
  1844.   Evaluate command (for a description of expressions).
  1845.  
  1846.   “Structured Commands” in Chapter 5.
  1847.  
  1848. æKY Browser
  1849. æC                Browser -- invoke Marker Browser
  1850.  
  1851.                   # The MPW Browser command is used to navigate source files or other text.  It 
  1852.                   # presents a window containing a list of the files in the current directory
  1853.                   # and, for the selected file, a list of markers.  Double-clicking on the marker
  1854.                   # opens the file with the selection point at the marker.  Entering a marker name
  1855.                   # in a text box searches all files in the directory for that marker, and if found 
  1856.                   # opens the file with the selection point at the marker.
  1857.  
  1858. æKY BuildCommands
  1859. æC                BuildCommands -- show build commands
  1860.  
  1861. BuildCommands program [option…] > commands
  1862.  option…                 # Make command options
  1863.  
  1864. Status code 0 is returned if the build commands are generated 
  1865. without error.  If an error occurs, the status code returned by Make is returned.
  1866.  
  1867.                            Description
  1868.  
  1869.   BuildCommands writes to standard output the commands needed to build
  1870.   the specified program.
  1871.  
  1872.   Make is used to generate the build commands. If file program.make
  1873.   exists, it is used as the makefile. If not, file MakeFile is used.
  1874.  
  1875.   The specified options control the generation of the build commands.
  1876.   The options are passed directly to Make. BuildCommands is used to
  1877.   implement the Show Build Commands and Show Full Build Commands menu
  1878.   items in the Build Menu.
  1879.  
  1880.  
  1881.                              Examples
  1882.  
  1883.   Open {Worksheet}
  1884.  
  1885.   BuildCommands Count >> {Worksheet} ≥≥ Dev:StdOut
  1886.  
  1887.   Generates the build commands for Count. The Worksheet window is brought
  1888.   to the front. The build commands, or any errors generated by Make
  1889.   are written at the end of the Worksheet. The Show BuildCommands menu
  1890.   item is implemented using similar commands.
  1891.  
  1892.  
  1893.                              See also 
  1894.  
  1895.   “Building a Program:  An Introduction” in Chapter 2
  1896.  
  1897.       
  1898. æKY BuildMenu
  1899. æC                  BuildMenu -- create the Build menu
  1900.  
  1901. Status codes returned:
  1902.  0    is always returned.
  1903.  
  1904.                            Description
  1905.  
  1906.   Creates the Build menu shown below. Each of the items in the menu
  1907.   is described in Chapter 3 of the MPW Manual.
  1908.  
  1909.  
  1910.                              Examples
  1911.  
  1912.   BuildMenu
  1913.  
  1914.   Creates the Build menu. This command should appear in the UserStartup
  1915.   file to create the Build menu.
  1916.  
  1917.  
  1918.                              See also 
  1919.  
  1920.   "Building a Program: An Introduction" in Chapter 2.
  1921.  
  1922. æKY BuildMenuIIGS
  1923. æC        BuildMenuIIGS -- adds CreateMakeIIGS to the Build menu
  1924. BuildMenuIIGS
  1925. æKY BuildProgram
  1926. æC             BuildProgram -- build the specified program
  1927.  
  1928. Status code 0 is returned if the build is completed without error. 
  1929. If an error occurs during the generation of the build commands, the status 
  1930. value returned by Make is returned. If an error occurs during the build, the 
  1931. Status value returned by the build step that detected the error (such as Asm 
  1932. or Link) is returned.
  1933.  
  1934. BuildProgram program [option…] > log
  1935.  option…                 # Make command options
  1936.  
  1937.                            Description
  1938.  
  1939.   Builds the specified program. A simple transcript of the build, including
  1940.   timing information and commands used to do the build, is written
  1941.   to standard output.
  1942.  
  1943.   Make is used to determine the commands needed to do the build. If
  1944.   file
  1945.  
  1946.   program.make exists, it is used as the makefile. If not, the file
  1947.   MakeFile is used.
  1948.  
  1949.   The options specified are passed directly to Make; they control the
  1950.   generation of the build commands. BuildProgram is used to implement
  1951.   the Build and Full Build menu items in the Build menu.
  1952.  
  1953.  
  1954.                              Examples
  1955.  
  1956.   Open {Worksheet}
  1957.  
  1958.   BuildProgram -e Count >> {Worksheet} ≥≥ Dev:StdOut
  1959.  
  1960.   Completely rebuilds Count. The Worksheet window is brought to the
  1961.   front. The transcript of the build and any errors are written at
  1962.   the end of the Worksheet. The Full Build menu command is implemented
  1963.   using similiar commands.
  1964.  
  1965.  
  1966.                              See also 
  1967.  
  1968.   "Building a Program:  An Introduction" in Chapter 2
  1969.  
  1970. æKY C
  1971. æC                            C -- C compiler
  1972.  
  1973. C [option…] [file]   < file > preprocessor ≥ progress
  1974.     -b                      # put string constants into code and generate PC-relative references
  1975.                             #   for function addresses
  1976.     -b2                     # implies '-b' above, and allows string constants to be overlaid
  1977.     -b3                     # overlaid string constants in code (but A5-relative references
  1978.                             # for function addresses)
  1979.     -bigseg                 # generate single large (>32K) code segment, 68020 only   
  1980.     -c                      # syntax check only, don't create object file
  1981.     -d name                 # equivalent to: #define name 1
  1982.     -d name=string          # equivalent to: #define name string
  1983.     -e                      # write preprocessor results to output
  1984.     -e2                     # implies '-e' above, and strips comments
  1985.     -elems881               # generate MC68881 code for transcendentals
  1986.     -i directory            # search for includes in directory
  1987.     -k directory            # create load/dump files in directory
  1988.     -m                      # generate 32-bit references for data (less efficient code)
  1989.     -mbg ch8                # v2.0 compatible macsbug symbols
  1990.     -mbg off                # no macsbug symbols in the code 
  1991.     -mbg on|full            # full macsbug symbols
  1992.     -mbg <n>                # macsbug symbols to length <n> (<n> can be 0..255)
  1993.     -mc68020                # generate MC68020 code 
  1994.     -mc68881                # generate MC68881 code for arithmetic operations
  1995.     -n                      # Turn pointer assignment incompatibility errors into warnings
  1996.     -notonce                # do not automatically suppress multiple inclusion of files
  1997.     -o objname              # generate code in file or directory objname
  1998.     -opt off                # don't apply code optimizations
  1999.     -opt on | full          # choose level of code optimization ( on is default );
  2000.                             #    can modify with [,nopeep] [,nocse]
  2001.                             #    ( no peephole, no common subexpression)
  2002.     -p                      # write progress information to diagnostic
  2003.     -r                      # warn on calling a function that has no definition
  2004.     -s segment              # generate code in segment
  2005.     -sym off                # don't generate SADE records
  2006.     -sym on | full          # generate SADE records; can modify with [,nolines] [,notypes] [,novars]
  2007.     -t                      # write compilation time to diagnostic
  2008.     -trace always|never     # enable/disable calls to profiler or MacApp debugger
  2009.                             #   (overrides #pragma trace on|off)
  2010.     -trace on|off           # enable/disable calls to profiler or MacApp debugger
  2011.                             #   (subject to #pragma trace on|off)
  2012.     -u name                 # equivalent to: #undef name
  2013.     -warnings on|off|full   # set warning level; "on" is the default
  2014.     -y directory            # create temporary files in directory
  2015.  
  2016. Status codes returned:
  2017.   0    Successful completion.
  2018.   1    Errors occurred.
  2019.  
  2020.                            Description
  2021.  
  2022.   Compiles the specified C source file. Compiling file Name.c creates
  2023.   object file Name.c.o. (By convention, C source filenames end in a
  2024.   “.c” suffix.) If no filenames are specified, standard input is compiled
  2025.   and the object file “c.o” is created.
  2026.  
  2027.   (Note that SADE object file information cannot be generated for standard
  2028.   input source files.)
  2029.  
  2030.   See the MPW 3.0 C Reference Manual for details of the C language
  2031.   definition.
  2032.  
  2033.                              Examples
  2034.  
  2035.   C -p Sample.c
  2036.  
  2037.   Compiles Sample.c, producing the object file Sample.c.o. Writes progress
  2038.   information to diagnostic output. (Sample.c is found in Examples:CExamples.)
  2039.  
  2040.  
  2041.                              See also 
  2042.  
  2043.   MPW3.0C Reference.
  2044.  
  2045.  
  2046. æKY Canon
  2047. æC                   Canon -- canonical spelling tool
  2048.  
  2049. Canon [option…] dictionary [file…]   < file > new
  2050.  -s                      # case sensitive replacement
  2051.  -a                      # assembler identifiers (include $, %, @)
  2052.  -c n                    # consider only the first n characters
  2053.  
  2054. Status codes returned:
  2055.   0    All files processed successfully.
  2056.   1    Error in command line.
  2057.   2    Other errors.
  2058.  
  2059.                            Description
  2060.  
  2061.   Canon copies the specified files to standard output, replacing identifiers
  2062.   with the canonical spellings given in dictionaryFile. If no files
  2063.   are specified, standard input is processed.
  2064.  
  2065.   DictionaryFile is a text file that specifies the identifiers to be
  2066.   replaced and their new (or canonical) spellings. Identifiers are
  2067.   defined as a letter followed by any number of letters or digits.
  2068.   (The underscore character ( _ ) is also considered a letter.) Each
  2069.   line in the dictionary contains either a pair of identifiers or a
  2070.   single identifier:
  2071.  
  2072.     • If two identifiers appear, the first is the identifier to replace,
  2073.     and the second is its canonical spelling. For example, the dictionary
  2074.     entry
  2075.  
  2076.     NIL NULL # change NIL to NULL
  2077.  
  2078.     changes each occurrence of “NIL” to “NULL”.
  2079.  
  2080.     • A single identifier specifies both the identifier to match
  2081.     and its canonical spelling. This feature is useful because the
  2082.     matching may not be case sensitive or restricted to a fixed number
  2083.     of characters. (See the “Options” section on the next page.)
  2084.     For example, the dictionary entry
  2085.  
  2086.     true
  2087.  
  2088.     changes all occurrences of “TRUE”, “True”, “tRUE”, and so on to “true”.
  2089.  
  2090.   You can specify a left context for the first identifier on each line
  2091.   of the dictionary by preceding it with a sequence of nonidentifier
  2092.   characters. Replacement will then occur only if the left context
  2093.   in the input file exactly matches the left context in the dictionary.
  2094.   For example, if C structure component upperLeft should be replaced
  2095.   with topLeft, the dictionary might include the following:
  2096.  
  2097.   .upperLeft topLeft
  2098.   ->upperLeft topLeft
  2099.  
  2100.   You can include comments in the dictionary file by using the # symbol:
  2101.   everything from the # to the end of the line is ignored.
  2102.  
  2103.     • Note: The file Canon.Dict is a sample dictionary file that’s
  2104.     included with MPW. (See the “Examples” section below.)
  2105.  
  2106.  
  2107.                              Examples
  2108.  
  2109.   The file Canon.Dict, in the Tools folder, contains a list of all
  2110.   of the identifiers used in the Standard C library and the Inside
  2111.   Macintosh C interfaces. This list was made from the Library Index
  2112.   in the MPW 2.0 C Reference. The entries in Canon.Dict look like the
  2113.   following:
  2114.  
  2115.   abbrevDate
  2116.   ABCallType
  2117.   abortErr
  2118.   ABProtoType
  2119.   abs
  2120.   acos
  2121.   activateEvt
  2122.   …
  2123.  
  2124.   The following command copies the file Source.c to the file Temp;
  2125.   identifiers whose first eight characters match a dictionary entry
  2126.   are replaced with that entry.
  2127.  
  2128.   Canon -c 8 {MPW}Tools:Canon.Dict Source.c > Temp
  2129.  
  2130.   The -c 8 option is useful when porting source code from other systems
  2131.   where only eight characters are significant.
  2132.  
  2133.     • Note: The list of Pascal identifiers used in the Inside Macintosh
  2134.     interface is almost identical to the list used in C. The dictionary
  2135.     Canon.Dict can also be used to port Pascal programs from other
  2136.     systems, as long as you use the canonical capitalizations for
  2137.     the various Standard C library identifiers.
  2138.  
  2139.   Limitations The maximum line length in the dictionary file is 256
  2140.   characters. Longer lines are considered an error. Identifiers and
  2141.   words in comment sections are replaced.
  2142.  
  2143. æKY Catenate
  2144. æC                    Catenate -- concatenate files
  2145.  
  2146. Catenate [file…]  < file > catenation
  2147.  
  2148. Status codes returned:
  2149.   0    All files were processed successfully.
  2150.   1    One or more files were not found.
  2151.   2    An error occurred in reading or writing.
  2152.  
  2153.                            Description
  2154.  
  2155.   Catenate reads the data fork of each file in sequence and writes
  2156.   it to standard output. If no input file is given, Catenate reads
  2157.   from standard input. None of the input files may be the same as the
  2158.   output file.
  2159.  
  2160.  
  2161.                              Examples
  2162.  
  2163.   Catenate Makefile.a
  2164.  
  2165.   Writes Makefile.a to the active window immediately following the
  2166.   command.
  2167.  
  2168.   Catenate File1 File2 > CombinedFile
  2169.  
  2170.   Concatenates the first two files and places the result in the third.
  2171.   If CombinedFile doesn’t exist, it will be created; if it exists,
  2172.   it will be overwritten.
  2173.  
  2174.   Set selection “`Catenate §`”
  2175.  
  2176.   Captures the selection from the target window in the Shell variable
  2177.   {selection}.
  2178.  
  2179.   Catenate >> {Worksheet}
  2180.  
  2181.   Appends all subsequently entered text to the Worksheet window (until
  2182.   you indicate end-of-file by pressing Command-Enter).
  2183.  
  2184.   Warning Beware of commands such as
  2185.  
  2186.   Catenate File1 File2 > File1
  2187.  
  2188.   The above command will cause the original data in File1 to be lost.
  2189.   To append one file to another, use the form
  2190.  
  2191.   Catenate File2 >> File1
  2192.  
  2193.  
  2194.                              See also 
  2195.  
  2196.   Duplicate command.
  2197.  
  2198.   “Redirecting Input and Output” in Chapter 5.
  2199.  
  2200. æKY CFront
  2201. æC                     CFront -- C++ to C translator
  2202.  
  2203. CFront [option…] [file…] < file > intermediate output ≥ progress
  2204.     -a                      # force ANSI-style intermediate C code (default)
  2205.     -a0                     # force K&R-style (pre-ANSI) intermediate C code
  2206.     -a1                     # force ANSI-style intermediate C code (default)
  2207.     -c                      # intermediate code to standard output; no object file
  2208.     -d name                 # equivalent to: #define name 1
  2209.     -d name=string          # equivalent to: #define name string
  2210.     -e                      # write preprocessor results to output
  2211.     -e2                     # implies '-e' above, and strips comments
  2212.     -elems881               # generate MC68881 code for transcendentals
  2213.     -f filename             # act as if input comes from named file when it actually is from stdin 
  2214.     -f1                     # send text version of C code to C compiler (no token stream)
  2215.     -i directory            # search for includes in directory
  2216.     -mc68020                # generate MC68020 code 
  2217.     -mc68881                # generate MC68881 code for arithmetic operations
  2218.     -mtbl0                  # suppress output of method tables for Object Pascal Classes
  2219.     -mtbl1                  # force output of method tables for Object Pascal Classes
  2220.     -n                      # Turn pointer assignment incompatibilty errors into warnings
  2221.     -p                      # write progress information to diagnostic
  2222.     -s segment              # generate code in segment
  2223.     -u name                 # equivalent to: #undef name
  2224.     -vtbl0                  # suppress output of virtual tables for ordinary class
  2225.     -vtbl1                  # force output of virtual tables for ordinary class
  2226.     -vtbl2                  # new improved output algorithm for virtual tables
  2227.     -w                      # suppress warnings
  2228.     -w1                     # generate additional warnings from CFront
  2229.     -w3                     # passed through to C compiler (supresses unused warnings)
  2230.     -y directory            # create temporary files in directory
  2231.     -z0                     # force 'inline' functions to be non-inline
  2232.     -z3                     # supress name encoding of local vars and struct members (default)
  2233.     -z4                     # encode names of local vars and struct members
  2234.     -z6                     # force enums always to be int variables
  2235.     -z7                     # relax requirement on static class member initialization 
  2236.  
  2237. æKY CheckIn
  2238. æC                CheckIn -- check a file into a project
  2239.  
  2240. CheckIn -w | -close | ([options…] files…) > progress
  2241.  -a                 # checkin all files in current directory
  2242.  -b                 # check in files… as branches
  2243.  -c                 # cancel if conflict occurs (avoids dialog)
  2244.  -cf file           # the comment is contained in file.
  2245.  -close             # close the Check In window
  2246.  -cs comment        # a description of changes made to the file
  2247.  -delete            # delete the file after checking it in
  2248.  -m                 # check out the files for modification after checking in
  2249.  -n                 # answer no to all dialogs (avoids dialogs)
  2250.  -new               # add a new file to the project
  2251.  -p                 # write progress information to standard output
  2252.  -project project   # name of project that contains the files
  2253.  -t task            # a short description of task accomplished
  2254.  -touch             # touch the mod date of file after checking in
  2255.  -u user            # name of current user
  2256.  -w                 # open the Check In window
  2257.  -y                 # answer yes to all dialogs (avoids dialogs)
  2258.  
  2259. Status codes returned:
  2260.   0    No errors.
  2261.   1    Syntax error.
  2262.   2    Error in processing.
  2263.   3    System error.
  2264.  
  2265.                            Description
  2266.  
  2267.   Return ownership of the specified files to Projector and save all
  2268.   changes as new revisions. The default is to leave you with a read-only
  2269.   copy of the file.
  2270.  
  2271.   File must be an HFS pathname. Projector determines the project each
  2272.   file belongs to by inspecting the file's resource fork. Since Projector
  2273.   puts the name of the project in the resource fork of checked-out
  2274.   files, files belonging to different projects can be checked in with
  2275.   a single command.
  2276.  
  2277.   If the -a (all) option is used instead of file..., Projector examines
  2278.   all files in the current directory and checks in all files in the
  2279.   current directory that have been checked out for modification. The
  2280.   files are checked into their respective projects.
  2281.  
  2282.   To add a new file to the project, use the -new option.
  2283.  
  2284.   When the file is checked in, Projector automatically increments the
  2285.   revision number by one. For example, if revision 2.17 was checked
  2286.   out, the new revision will be 2.18. To override this, use the ProjectInfo
  2287.   command to find the revision number, increase it by the amount desired,
  2288.   and then check the file in, using the “filename,rev” notation. For
  2289.   example, if file.c revision 2.17 was checked out, you could check
  2290.   it in as file.c,3.0 to jump to the next major revision level.
  2291.  
  2292.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  2293.   symbols used in Projector commands.
  2294.  
  2295.  
  2296.                              Examples
  2297.  
  2298.   CheckIn file.c -cs “added some comments”
  2299.  
  2300.   Check in file.c to the current project. A new revision of file.c
  2301.   is created and the user is left with a read-only copy of the file.
  2302.   The comment is saved with the new revision. Because no revision number
  2303.   is specified, Projector simply increases the revision number by one.
  2304.  
  2305.   CheckIn file.c interface.c,5 -t “Added -x option”
  2306.  
  2307.   -cf commentFile
  2308.  
  2309.   This command checks in two files reading the comment from the file
  2310.   commentFile. The task is also saved with the new revisions. The user
  2311.   is left with read-only copies of the files. The new revision for
  2312.   interface.c is revision 5.
  2313.  
  2314.   CheckIn hd:work:file.c hd:work:main.c -m
  2315.  
  2316.   The files to be checked in are hd:work:file.c and :main.c. After
  2317.   the command executes, the user still has modifiable copies of the
  2318.   files.
  2319.  
  2320.   CheckIn -new file.c
  2321.  
  2322.   To check a new file into the project use the -new option. The above
  2323.   command adds file.c to the current project.
  2324.  
  2325.   CheckOut -project Zoom∫Utilities∫MyProject file.c -m
  2326.  
  2327.   ...edit the file...
  2328.  
  2329.   CheckIn -project Zoom∫Utilities∫MyProject file.c -b
  2330.  
  2331.   The preceding command sequence illustrates the usefulness of the
  2332.   -b option. In this case, the user checked out a write-privileged
  2333.   copy of the latest revision of file.c from the current project, edited
  2334.   the file, and then, using the branch option, checked in the file
  2335.   on a branch.
  2336.  
  2337.  
  2338.                              See also 
  2339.  
  2340.   CheckOut and CheckOutDir.
  2341.  
  2342. æKY CheckOut
  2343. æC              CheckOut -- check a file out from a project
  2344.  
  2345. CheckOut -w | -close | ([options…] files…) > progress
  2346.  -a                    # check out all the files in the current project
  2347.  -b                    # checkout specified files on a new branch
  2348.  -c                    # cancel if conflict occurs (avoids dialog)
  2349.  -cancel               # cancel the checkout of the files
  2350.  -cf file              # the comment is contained in files
  2351.  -close                # close the Check Out window
  2352.  -cs comment           # a short description of changes
  2353.  -d dir                # directory where the checked out files should go
  2354.  -m                    # check out a modifiable copy of the file
  2355.  -n                    # answer no to all dialogs (avoids dialogs)
  2356.  -newer                # checkout latest copy of all files in the project
  2357.  -noTouch              # don't touch the mod date of the checked out files
  2358.  -open                 # open the files after checking out
  2359.  -p                    # write progress information to standard output
  2360.  -project project      # name of project that contains the files
  2361.  -r                    # recursively checkout files
  2362.  -t task               # a short description of task accomplished
  2363.  -u user               # name of current user
  2364.  -update               # checkout latest copy of all files you already have
  2365.  -w                    # open the Check Out window
  2366.  -y                    # answer yes to all dialogs (avoids dialogs)
  2367.  
  2368. Status codes returned:
  2369.   0    No errors.
  2370.   1    Syntax error.
  2371.   2    Error in processing.
  2372.   3    System error.
  2373.  
  2374.                            Description
  2375.  
  2376.   Under Projector, CheckOut obtains copies of file revisions from a
  2377.   project. The default is to check out read-only copies. Unless otherwise
  2378.   specified, copies are placed in the checkout directory associated
  2379.   with the project.
  2380.  
  2381.   If file is a leafname (that is, file.c), Projector checks out the
  2382.   latest revision of the file from the current project. If file specifies
  2383.   a revision (for example, file.c,22), that revision is checked out.
  2384.  
  2385.   If file is a partial or full HFS pathname (that is, :work:file.c
  2386.   or HD:work:file.c), the file does not go into the checkout directory.
  2387.   Instead, Projector checks out the file (that is, file.c) in the current
  2388.   project and places the copy in the specified HFS location (that is,
  2389.   in the :work: or HD:work: directory, respectively).
  2390.  
  2391.   Finally, file may be a Name. See the NameRevisions command for more
  2392.   information about Names. The Name is expanded and the corresponding
  2393.   revisions are checked out.
  2394.  
  2395.   To check out an old revision for modification, you must specify the
  2396.   -b (branch) option.
  2397.  
  2398.   If you are checking out revision 5 of file.c into hd:work and Projector
  2399.   determines that you already have that revision in the work directory,
  2400.   Projector will not recopy the data of revision 5. This is especially
  2401.   nice when you are checking out a revision for modification, and you
  2402.   already have a read-only copy of that revision.
  2403.  
  2404.   See Chapter 7 of MPW manual for complete definitions of the terms and
  2405.   symbols used in Projector commands.
  2406.  
  2407.  
  2408.                              Examples
  2409.  
  2410.   CheckOut -m -project Zoom∫Utilities∫MyProject file.c
  2411.  
  2412.   Checks out a write-privileged copy of the latest revision of file.c
  2413.   from the Zoom∫Utilities∫MyProject project. The file is placed in
  2414.   the checkout directory for the project.
  2415.  
  2416.   CheckOut -m file.c
  2417.  
  2418.   The above command checks out the latest revision of file.c for modification.
  2419.   The file is placed in the checkout directory for the project. If
  2420.   you already happen to have the latest revision of file.c in the checkout
  2421.   directory, then Projector only updates the 'ckid' resource of file.c
  2422.   to indicate that it is now a modifiable file.
  2423.  
  2424.   CheckOut -project Zoom∫Utilities∫Kerfroodi file.c,22
  2425.  
  2426.   The above command checks out a read-only copy of revision 22 of file.c
  2427.   from the Zoom∫Utilities∫Kerfroodi project. The file is placed in
  2428.   the checkout directory for the project.
  2429.  
  2430.   Project Zoom∫Utilities∫Kerfroodi
  2431.  
  2432.   CheckOut file.c -t “Fix Bug 7” -m -d “{Zoom}UtilitiesSrc:Kerfroodi”
  2433.  
  2434.   By setting the current project with the Project command you don’t
  2435.   need to specify a project on subsequent Projector commands. By setting
  2436.   the task other users will be able to see why you have checked out
  2437.   file.c. The files are placed in {Zoom}UtilitiesSrc:Kerfroodi.
  2438.  
  2439.   CheckOut -a -d HD:Work:Test
  2440.  
  2441.   The above example checks out read-only copies of all of the files
  2442.   in the current project and places the copies in the directory HD:work:Test.
  2443.  
  2444.   CheckOut -a -project Zoom∫ -r
  2445.  
  2446.   Checks out read-only copies of all files in the Zoom project and
  2447.   all of its subprojects. Its behavior is the same as if you had executed
  2448.   these commands individually:
  2449.  
  2450.   CheckOut -a -project Zoom∫
  2451.  
  2452.   CheckOut -a -project Zoom∫Voom
  2453.  
  2454.   CheckOut -a -project Zoom∫Utilities
  2455.  
  2456.   CheckOut -a -project Zoom∫Utilities∫MyProject
  2457.  
  2458.   ...
  2459.  
  2460.   You can conveniently update the read-only files (from the current
  2461.   project) in the current directory without affecting any files checked
  2462.   out for modification. To do this, use the -update option:
  2463.  
  2464.   CheckOut -update -d :
  2465.  
  2466.  
  2467.                              See also 
  2468.  
  2469.   CheckIn and CheckOutDir.
  2470.  
  2471. æKY CheckOutDir
  2472. æC  CheckOutDir -- specify the directory where checked out files will placed
  2473.  
  2474. CheckOutDir [-project project | -m] [-r] [-x | directory]
  2475.  -project project # name of project to associate with the checkout directory
  2476.  -m               # list the checkout directories of all root projects
  2477.  -r               # recursively set or display the checkout directories
  2478.  -x               # reset the checkout directories to ":"
  2479.  
  2480. Status codes returned:
  2481.   0    No errors.
  2482.   1    Syntax error.
  2483.   2    Error in processing.
  2484.   3    System error.
  2485.  
  2486.                            Description
  2487.  
  2488.   Under Projector, CheckOutDir changes the checkout directory associated
  2489.   with the current project to the HFS pathname directory. From this
  2490.   point on, files checked out of the named project are placed, by default,
  2491.   into this directory. The directory is created if it does not exist.
  2492.   When a project is mounted, the checkout directory is initially set
  2493.   to “:”—that is, the current directory.
  2494.  
  2495.   It is recommended that you put CheckOutDir commands immediately following
  2496.   the corresponding MountProject commands you place in your UserStartup
  2497.   file, script, or AddMenu for project initialization.
  2498.  
  2499.   If directory is missing, the checkout directory of the current project
  2500.   is written to standard output in the form of a CheckOutDir command.
  2501.  
  2502.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  2503.   symbols used in Projector commands.
  2504.  
  2505.  
  2506.                              Examples
  2507.  
  2508.   CheckOutDir HD:work:Test
  2509.  
  2510.   This command causes subsequent files in the current project to be
  2511.   checked out to the HD:work:Test folder.
  2512.  
  2513.   CheckOutDir
  2514.  
  2515.   CheckOutDir -project Zoom∫Utilities∫Test HD:work:Test
  2516.  
  2517.   The above command outputs the checkout directory of the current project
  2518.   in the form of a CheckOutDir command.
  2519.  
  2520.   CheckOutDir -project Zoom∫ -r
  2521.  
  2522.   CheckOutDir -project Zoom∫ :
  2523.  
  2524.   CheckOutDir -project Zoom∫Vroom :
  2525.  
  2526.   CheckOutDir -project Zoom∫Utilities :
  2527.  
  2528.   CheckOutDir -project Zoom∫Utilities∫Test HD:work:Test
  2529.  
  2530.   The -r option lets you display the checkout directory for the current
  2531.   project and all subprojects. In this case, only the sort project
  2532.   has a checkout directory setting that differs from the default.
  2533.  
  2534.   The -r option can also be used to set the checkout directories of
  2535.   a complex project to mirror the projects own hierarchical structure.
  2536.   For example:
  2537.  
  2538.   CheckOutDir -project Zoom∫ -r HD:Work:
  2539.  
  2540.   After executing the above command, listing the checkout directories
  2541.   for the projects under Zoom yields
  2542.  
  2543.   CheckOutDir -project Zoom∫ -r
  2544.  
  2545.   CheckOutDir -project Zoom∫ HD:work:
  2546.  
  2547.   CheckOutDir -project Zoom∫Vroom HD:Work:Vroom
  2548.  
  2549.   CheckOutDir -project Zoom∫Utilities HD:Work:Utilities
  2550.  
  2551.   CheckOutDir -project Zoom∫Utilities∫Test HD:Work:Utilities:Test
  2552.  
  2553.   Notice how the directory structure is similar to the project structure.
  2554.   The directories are created if they do not exist.
  2555.  
  2556.   The -m option lists the checkout directories of the root projects.
  2557.   For example
  2558.  
  2559.   CheckOutDir -m
  2560.  
  2561.   CheckOutDir -project Zoom∫ HD:Work:Zoom
  2562.  
  2563.   CheckOutDir -project Test∫ HD:Test
  2564.  
  2565.  
  2566.                              See also 
  2567.  
  2568.   MountProject, CheckIn, and CheckOut.
  2569.  
  2570. æKY CIIGS
  2571. æC                CIIGS -- the MPW IIGS C Compiler
  2572. CIIGS [option…] [file] < file > preprocessor ≥ progress
  2573.  -d name               # equivalent to: #define name 1
  2574.  -d name=string        # equivalent to: #define name string
  2575.  -i directory          # search for includes in directory
  2576.  -o objname            # generate code in file objname
  2577.  -p                    # write progress information to diagnostics
  2578.  -s segment            # name the default load segment
  2579.  -u name               # equivalent to: #undef name
  2580. æKY Choose
  2581. æC   Choose -- choose or list network file server volumes and printers
  2582.  
  2583. Choose [option…] [[zone]:server[:volume] …]
  2584.  -askpw                # ask for server password (in a "safe" dialog box)
  2585.  -askvp                # ask for volume password (in a "safe" dialog box)
  2586.  -c                    # output in the form of further "Choose" commands.
  2587.  -cp                   # print driver name and type of current printer.
  2588.  -dr driverFileName    # name of printer driver file in system folder 
  2589.                        # (e.g. "LaserWriter")
  2590.  -guest                # log-in to the file server as a guest.
  2591.  -list                 # list entities (don't choose them).
  2592.  -p                    # print version information.
  2593.  -pr                   # choose printers (instead of file servers).
  2594.  -pw password          # specify server log-in password.
  2595.  -u username           # specify user name for server log-in.
  2596.  -v                    # verbose (print names of volumes really mounted).
  2597.  -vp volumePassword    # specify volume password (to mount it).
  2598.  -type type            # specify type of entity to list or choose (or '≈').
  2599.  
  2600.  Names take the form     "zone:server:volume"
  2601.  
  2602.  The wildcard '≈' may be used in place of a zone, server, volume or
  2603.  type name.  A leading ':' (empty zone name) or '*:' indicates the
  2604.  current zone.  A name of the form "…server:" will mount all volumes
  2605.  on the server, unless a specific volume name is given.
  2606.  
  2607. Status codes returned:
  2608.   0    No errors.
  2609.   1    Syntax error on command line.
  2610.   3    Any other error.
  2611.  
  2612.                            Description
  2613.  
  2614.   Choose noninteractively mounts or lists the specified AppleShare
  2615.   volumes or printers. Each name takes the form
  2616.  
  2617.   [zone]:[server[:volume]]
  2618.  
  2619.   (“Server” means any file or printer server.) The zone name is always
  2620.   optional and defaults to the current zone. A server name must be
  2621.   preceded by (at least) a colon. Volume names are only applicable
  2622.   to file servers.
  2623.  
  2624.   When mounting file server volumes, a server name is required. If
  2625.   a volume name is specified, only that volume is mounted. If the volume
  2626.   name is omitted, or if it is the wildcard character “≈”, all volumes
  2627.   on the server are mounted:
  2628.  
  2629.   [zone]:server:volume
  2630.  
  2631.   [zone]:server[:≈]
  2632.  
  2633.   When -list is specified, the wildcard character “≈” may be used in
  2634.   place of names in all of the fields: “≈” in the zone field expands
  2635.   to all zones; “≈” in the server field expands to all servers in the
  2636.   specified zones; “≈” in the volume-name field expands to volumes
  2637.   on the specified servers (listing volumes on a server requires a
  2638.   server login—that is, as a user with a valid password or as a guest).
  2639.   If the wildcard character “≈” is used, it must be quoted so that
  2640.   the Shell will not expand it.
  2641.  
  2642.   The -list option also expands the next unspecified item in a name.
  2643.   A zone name followed by nothing else expands to a list of servers
  2644.   in that zone, and a server name followed by nothing else expands
  2645.   to a list of volumes on the server.
  2646.  
  2647.   If a “≈”, “:” or “” character appears in a server, volume, or zone
  2648.   name, it may be quoted with the character “”. This quoting mechanism
  2649.   supplements quoting already performed by the Shell.
  2650.  
  2651.   Any number of volumes may be mounted (though a system-dependent limit
  2652.   exists on the number of active server connections). Only one printer
  2653.   may be chosen at a time, since only one printer can be active.
  2654.  
  2655.   Server and volume passwords are case sensitive. More than one server
  2656.   and volume may be mounted with a single command, but the server and
  2657.   volume passwords must be the same for each, since at most one password
  2658.   of each type may be specified on the command line.
  2659.  
  2660.  
  2661.                              Examples
  2662.  
  2663.   Choose :Linker:Sources
  2664.  
  2665.   Mount the volume Sources on the server Linker, located in the current
  2666.   zone, using the default user name, server password, and volume password.
  2667.  
  2668.   Choose -v -guest 'Systems:Sources:Doc' 'Systems:Games:≈'
  2669.  
  2670.   Mount the volume Doc on the server Sources and every volume on the
  2671.   server Games in the zone Systems as a guest. Print the names of the
  2672.   volumes that are mounted by the command. List the names of all zones.
  2673.   Notice that the wildcard character “≈” is quoted.
  2674.  
  2675.   Choose -list 'Whale Zone:≈' 'Whale Zone:Moby Dick:≈' '≈:'
  2676.  
  2677.   List all file servers in the zone Whale Zone, all volumes on the
  2678.   file server Moby Dick in that zone (after logging in with the default
  2679.   user name and server password) and all zones (with their servers).
  2680.  
  2681.   Choose -pr -list ':≈'
  2682.  
  2683.   Choose -cp -pr Zarf:Kitchen Sink
  2684.  
  2685.   List all printers of the current type in the current zone. Print
  2686.   the name of the currently selected printer, then select the printer
  2687.   called Kitchen Sink in the zone Zarf.
  2688.  
  2689.   Choose -list -type Fortune Cookie Server '≈:≈'
  2690.  
  2691.   List all network entities of type Fortune Cookie Server in all zones.
  2692.  
  2693.  
  2694.                              See also 
  2695.  
  2696.   Unmount and Volumes commands.
  2697.  
  2698.  
  2699.  
  2700. æKY Clear
  2701. æC                     Clear -- clear the selection
  2702.  
  2703. Clear [-c count] selection [window]
  2704.  -c count                # repeat the Clear count times
  2705.  
  2706. Status codes returned:
  2707.   0    At least one instance of selection was found.
  2708.   1    Syntax error.
  2709.   2    Any other errors.
  2710.  
  2711.                            Description
  2712.  
  2713.   Finds selection and deletes its contents. The selection is not copied
  2714.   to the Clipboard. (For a definition of selection, see Chapter 6 of the
  2715.   MPW manual.)
  2716.  
  2717.   If window is specified, the Clear command acts on that window. It’s
  2718.   an error to specify a window that doesn’t exist. If no window is
  2719.   specified, the command operates on the target window (the second
  2720.   window from the front).
  2721.  
  2722.  
  2723.                              Examples
  2724.  
  2725.   Clear §
  2726.  
  2727.   Deletes the current selection. This is like the Clear command in
  2728.   the menu bar, except that the action occurs in the target window
  2729.   rather than the active window.
  2730.  
  2731.   Clear /BEGIN/:/END/
  2732.  
  2733.   Selects everything from the next BEGIN through the following END,
  2734.   and deletes the selection.
  2735.  
  2736.  
  2737.                              See also 
  2738.  
  2739.   Cut and Replace commands.
  2740.  
  2741.   “Selections” in Chapter 6 (see Appendix B for a summary).
  2742.  
  2743. æKY Close
  2744. æC                   Close -- close specified windows
  2745.  
  2746. Close [-y | -n | -c] [ -a | window…]
  2747.  -y                  # save modified windows before closing (avoids dialog)
  2748.  -n                  # don't save any modified windows (avoids dialog)
  2749.  -c                  # cancel if there is a modified window (avoids dialog)
  2750.  -a                  # close all the windows
  2751.  
  2752. Status codes returned:
  2753.   0    No errors.
  2754.   1    Syntax error 
  2755.   2    Any other error, such as “Window not found.”
  2756.   4    Cancelled from dialog.
  2757.  
  2758.                            Description
  2759.  
  2760.   Close the window or windows specified by window. If no window is
  2761.   specified, the target window is closed. If changes to the window
  2762.   have not been saved, a dialog box requests confirmation of the Close
  2763.   command. In scripts you can use the -y, -n, or -c option to avoid
  2764.   this interaction. Use the -a option instead of window to close all
  2765.   of the open windows (other than the Worksheet).
  2766.  
  2767.  
  2768.                              Examples
  2769.  
  2770.   Close
  2771.  
  2772.   Closes the target window, prompting the user with a confirmation
  2773.   dialog box if needed.
  2774.  
  2775.   Close -a -y
  2776.  
  2777.   Saves and closes all open windows.
  2778.  
  2779.   Close -n Test.a Test.r
  2780.  
  2781.   Closes the windows Test.a and Test.r without saving any of the changes.
  2782.  
  2783.  
  2784.                              See also 
  2785.  
  2786.   “File Menu” in Chapter 3.
  2787.       
  2788. æKY CMarker
  2789. æC          CMarker -- generate Mark commands for C and C++ function definitions
  2790.                      
  2791. CMarker [option…] [file…]
  2792.  -a[nachronisms]         # suppress anachronisms messages
  2793.  -d[efine] name[=string] # define name to the preprocessor (same as #define)
  2794.      [,name[=string]]… 
  2795.  -e                      # show macro expansion in the listing (default with -ppout)
  2796.  -ext[ensions] on|off    # turn on or off Apple compiler extensions (default on)
  2797.  -errors                 # suppress marking if errors are detected
  2798.  -i[ncludes] pathname    # search for include files in the specified directories (Max of 15)
  2799.      [,pathname],… 
  2800.  -lang[uage] C|"C++"     # specify target sources as either C or C++ (Default is C)
  2801.  -linesize n             # maximum number of characters generated in a single listing line
  2802.  -l[ist[ing]]            # generate a listing of the source to stdout
  2803.  -mc68881                # define the macro name mc68881 as having the value 1
  2804.  -msi                    # mark include (header) files
  2805.  -pp                     # preprocessing only (no markers will be generated)
  2806.  -ppout filename         # write the preprocessor output to the specified filename
  2807.  -p[rogress]             # write version, progress and summary information to stderr
  2808.  -showskipped            # show lines skipped by conditional compilation in the listing output
  2809.  -t                      # display processing time and number of lines to stderr
  2810.  -u[ndefine] name        # undefine the preprocessor symbol name  (same as #undef)
  2811.     [,name]…
  2812.  
  2813. Status codes returned:
  2814.    0   No errors.
  2815.    1   Parameter or option error.
  2816.    2   Execution error.
  2817.    3   Syntax errors.
  2818.    
  2819.                            Description
  2820.  
  2821. CMarker reads the specified C++/ANSI C source file(s), syntax checks them and 
  2822. generates appropriate "Open" and "Mark" MPW commands, which, when executed, 
  2823. will mark the source file(s) at each function definition with the marker name being the 
  2824. name of the function.  It's purpose is to aid in the marking of source files for use with 
  2825. the MPW "marker browser" capability.  CMarker contains a full ANSI C preprocessor 
  2826. and provides options to mark include files, generate source listings (with or without 
  2827. showing macro expansions), run the preprocessor only, flag anachronisms, and syntax 
  2828. check C++/ANSI C with or without Apple extensions.  CMarker runs as an MPW Tool. 
  2829.  
  2830. æKY Commando
  2831. æC          Commando -- present a dialog interface for commands
  2832.  
  2833. Commando [command] [-modify]
  2834.     -modify                 # enable Commando’s built-in editor
  2835.  
  2836. Status codes returned:
  2837.   0    The Do It button was selected.
  2838.   1    The Cancel button was selected.
  2839.   2    Error occurred while parsing the cmdo resource.
  2840.   3    I/O or program error.
  2841.  
  2842.                            Description
  2843.  
  2844.   The Commando interface lets you operate any properly configured MPW
  2845.   tool or script using specialized Macintosh dialog boxes instead of
  2846.   the ordinary command line method. The dialogs make it easy to find
  2847.   options and build up complex command lines.
  2848.  
  2849.   Commands with many options and parameters may employ one or more
  2850.   nested dialog boxes. See “Commando Dialogs” in Chapter 4 of the MPW manual
  2851.   for more information on the basics of using the Commando dialogs. Chapter
  2852.   13 describes the structure of the Commando resource and shows how
  2853.   to create Commando dialogs for your own tools and scripts.
  2854.  
  2855.   The controls of a Commando dialog box, including text fields, buttons,
  2856.   titles, and so on, can be sized and moved within the dialog box by
  2857.   using the mouse, exactly as you would drag an object in the Finder.
  2858.   See “Editing Commando Dialogs” in Chapter 13 for information on moving
  2859.   and sizing controls.
  2860.  
  2861.  
  2862.                              Examples
  2863.  
  2864.   Commando Rez
  2865.  
  2866.   Displays the frontmost Rez dialog box shown under “Rez” in Part II.
  2867.  
  2868.   Rez…
  2869.  
  2870.   Displays the frontmost Rez dialog box shown under “Rez” in Part II,
  2871.   exactly as in the previous example.
  2872.  
  2873.  
  2874.                              See also 
  2875.  
  2876.   “Invoking Commando” in Chapter 4.
  2877.  
  2878.   Chapter 13.
  2879.  
  2880. æKY Compare
  2881. æC                    Compare -- compare text files
  2882.  
  2883. Compare [option…] file1 [file2]  < file2 > differences ≥ progress
  2884.  -b                      # treat several blanks or tabs as a single blank
  2885.  -c c1-c2[,c1-c2]        # compare only specified columns
  2886.  -d depth                # maximum stack depth
  2887.  -e context              # display specified number of context lines
  2888.  -g groupingFactor       # grouping factor (matching lines for resync)
  2889.  -h width                # write differences horizontally
  2890.  -l                      # lower case (i.e. ignore case differences)
  2891.  -m                      # suppress displays of mismatched lines 
  2892.  -n                      # don't write to output if files match
  2893.  -p                      # write progress information to diagnostics
  2894.  -s                      # use static grouping factor
  2895.  -t                      # ignore trailing blanks
  2896.  -v                      # suppress line numbers in vertical displays
  2897.  -x                      # don't expand tabs
  2898.  
  2899. Status codes returned:
  2900.   0    Files match.
  2901.   1    Parameter or option error.
  2902.   2    Files don’t match.
  2903.  
  2904.                            Description
  2905.  
  2906.   Compares the lines of two text files and writes their differences
  2907.   to standard output. Options are provided to compare a specific column
  2908.   range in each file
  2909.  
  2910.   (-c), to ignore blanks (-b), and to ignore case (-l).
  2911.  
  2912.   Both files are read and compared line for line. As soon as a mismatch
  2913.   is found, the two mismatched lines are stored in two stacks, one
  2914.   for each file. Lines are then read alternately (starting from the
  2915.   next input line in file2 ) until a match is found to put the files
  2916.   back in synchronization. If such a match is found, Compare writes
  2917.   the mismatched lines to standard output.
  2918.  
  2919.   Files are considered resynchronized when a certain number of lines
  2920.   in the two stacks exactly match. By default, the number of lines,
  2921.   called the grouping factor, is defined by the formula
  2922.  
  2923.   G = Trunc((2.0 * Log10(M)) + 2.0)
  2924.  
  2925.   where G is the grouping factor and M is the number of lines saved
  2926.   in each stack so far. This definition requires more lines to be the
  2927.   same after larger mismatches. Using this formula, the following table shows
  2928.   the grouping factor G as a function of the number of mismatched lines:
  2929.  
  2930.   M: Number of G: Grouping
  2931.  
  2932.   mismatched lines factor
  2933.  
  2934.   1 to 3 2
  2935.  
  2936.   4 to 9 3
  2937.  
  2938.   10 to 31 4
  2939.  
  2940.   32 to 99 5
  2941.  
  2942.   100 to 315 6
  2943.  
  2944.   316 to 999 7
  2945.  
  2946.   1000 to 3161 8
  2947.  
  2948.   3162 to 9999 9
  2949.  
  2950.   With the default dynamic grouping, the -g option sets the lower limit
  2951.   for G (which must be at least 2, because the formula is always applied).
  2952.   The -s option lets you fix G as a static constant. A static G may
  2953.   be desirable under some circumstances, but may also resynchronize
  2954.   the files at undesirable points, especially if G is too small. It’s
  2955.   recommended that you use the default (dynamic G ) first; if the results
  2956.   aren’t satisfactory, try a higher minimum value of dynamic G (such
  2957.   as 3 or 4). If that is still unsatisfactory, try the static G option.
  2958.  
  2959.   With either option, there’s a limit on the depth of the stacks— that
  2960.   is, on how far out of synchronization the two files can get before
  2961.   they’re no longer worth comparing. For a dynamic G, the limit on
  2962.   the number of mismatched lines is 1000, but you can choose a lower
  2963.   limit with the -d option. For the static G option, typical values
  2964.   for G are 1 to 5, and the stack depth should be between about 10
  2965.   and 50 (the default limit is 25).
  2966.  
  2967.  
  2968.                              Examples
  2969.  
  2970.   Compare File File.bak > Mismatches
  2971.  
  2972.   Compares File and File.bak, writing the results to the file Mismatches.
  2973.   No options are specified, so dynamic grouping is used, blanks are
  2974.   retained, tabs are expanded into spaces, and matching is case sensitive.
  2975.  
  2976.   Compare File.old.§ File.new.§
  2977.  
  2978.   Compares the selected portions of the two windows and writes out
  2979.   the results.
  2980.  
  2981.   Limitations Compare can handle text files with a maximum line length
  2982.   of 255 characters.
  2983.  
  2984.   The text files compared should be fewer than 9999 lines long, because
  2985.   the displays are formatted based on four-digit line numbers.
  2986.  
  2987.  
  2988.                              See also 
  2989.  
  2990.   Equal command (Equal is a quicker command that tells you whether
  2991.   files are different, but stops at the first byte at which they differ).
  2992.  
  2993. æKY CompareFiles
  2994. æC  CompareFiles -- compare text files and interactively view differences
  2995.  
  2996. CompareFiles [-9 | -13 | -b x y | -Portrait | -TwoPage] oldFile newFile
  2997.  -9                      # assume a screen size of 512 x 342
  2998.  -13                     # assume a screen size of 640 x 480
  2999.  -b x y                  # tile windows into the rectangle specified by x y
  3000.  -Portrait               # screen size for Apple Macintosh Portrait Display
  3001.  -TwoPage                # screen size for Apple Two-Page Monochrome Monitor
  3002.  
  3003. Status codes returned:
  3004.   0    The files match.
  3005.   1    Syntax error.
  3006.   2    The files differ.
  3007.  
  3008.                            Description
  3009.  
  3010.   CompareFiles compares two text files (using the tool Compare) and,
  3011.   if there are any differences, displays the file in adjacent windows
  3012.   for interactively viewing the differences. A menu will be appended
  3013.   to the menu bar to go through the changes.
  3014.  
  3015.   When all the changes have been shown, the windows will be closed
  3016.   (if they were closed when CompareFiles started) and the menu will
  3017.   be deleted.
  3018.  
  3019.   The Compare menu contains four items for viewing and editing the
  3020.   differences. The items perform the following actions:
  3021.  
  3022.   Find Next Change Finds the next difference and highlights the changes
  3023.   in each window. (Notice that the differences are shown from bottom
  3024.   to top. This is so editing changes will not affect the file offsets
  3025.   recorded from the Compare tool.)
  3026.  
  3027.   Copy Selection »» Replaces the changed text in the new file with
  3028.   the old text.
  3029.  
  3030.   Copy Selection «« Replaces the old text with the changed text from
  3031.   the new file.
  3032.  
  3033.   Done Closes the files (asking if you want to save changes) and deletes
  3034.   the Compare menu. Use this item to close all the windows and delete
  3035.   the menu. (If you close any of the windows yourself, they will not
  3036.   be restored to their previous size and position.)
  3037.  
  3038.   The figure below shows the CompareFiles menu.
  3039.  
  3040.  
  3041.  
  3042.  
  3043.                              Examples
  3044.  
  3045.   CompareFiles Sample.old Sample.c
  3046.  
  3047.   Compares the file Sample.c to Sample.old. If there are some differences,
  3048.   those two files are opened side by side on the screen.
  3049.  
  3050.   CompareFiles -b 1024 1024 Sample.old Sample.c
  3051.  
  3052.   Compares the file Sample.c to Sample.old. If there are differences,
  3053.   the files are opened and tiled into a 1024 by 1024 rectangle.
  3054.  
  3055.  
  3056.                              See also 
  3057.  
  3058.   Compare Tool.
  3059.  
  3060. æKY CompareRevisions
  3061. æC   CompareRevisions -- compare two revisions of a file in a project
  3062. CompareRevisions file…
  3063.  
  3064. Status codes returned:
  3065.   0    No Errors.
  3066.   1    Syntax Error.
  3067.   2    Error in Processing.
  3068.   3    System Error.
  3069.  
  3070.                            Description
  3071.  
  3072.   Compare the revision of the HFS file file with another revision of
  3073.   that same file.
  3074.  
  3075.   CompareRevisions uses the ProjectInfo command to determine what project
  3076.   file belongs to and what its revision is. CompareRevisions then displays
  3077.   a list of the other revisions of the file for the user to choose.
  3078.   CompareRevisions checks this other revision out and calls the CompareFiles
  3079.   script to display both revisions on the screen and to highlight the
  3080.   differences between them. CompareFiles puts up an AddMenu named Compare
  3081.   to help you step through the differences between the two revisions.
  3082.  
  3083.   The file must belong to a currently mounted project. If the project
  3084.   that the file belongs to is not currently mounted, CompareRevisions
  3085.   displays an Alert.
  3086.  
  3087.   CompareRevisions uses the CompareFiles script.
  3088.  
  3089.  
  3090.                              Examples
  3091.  
  3092.   CompareRevisions file.c
  3093.  
  3094.   This example compares the revision in HFS file “file.c” in the working
  3095.   directory with any other revisions of file.c in the project.
  3096.  
  3097.   AddMenu Project 'Compare Revisions' 'CompareRevisions {Active} ∑∑ {WorkSheet}'
  3098.  
  3099.   This example adds CompareRevisions to the Project menu and allows
  3100.   you to compare revisions by opening the file you wish to compare
  3101.   and then selecting the 'Compare Revisions' menu item in the Project
  3102.   menu.
  3103.  
  3104.  
  3105.                              See also 
  3106.  
  3107.   CompareFiles.
  3108.  
  3109. æKY Confirm
  3110. æC             Confirm -- display a confirmation dialog box
  3111.  
  3112. Confirm [-t] [message…] < file
  3113.  -t                      # three buttons (Yes, No, Cancel)
  3114.  
  3115. Status codes returned:
  3116.   0    The OK button was selected.
  3117.   1    Syntax error.
  3118.   4    The Cancel button was selected or the No button was clicked in a three-way    dialog box.
  3119.   5    The Cancel button was selected in a three-way dialog box; see the -t option.
  3120.  
  3121.                            Description
  3122.  
  3123.   Confirm displays a confirmation dialog box with OK and Cancel buttons
  3124.   and the prompt message. There is no output to this command: the result
  3125.   of the dialog is returned in the {Status} variable.
  3126.  
  3127.   Note: Because Confirm returns a nonzero status value to indicate
  3128.   that No or Cancel was selected, a script should set the Shell variable
  3129.   {Exit} to zero before executing the Confirm command. (This step is
  3130.   necessary because the Shell aborts script processing when a nonzero
  3131.   status value is returned and {Exit} is nonzero.)
  3132.  
  3133.  
  3134.                              Examples
  3135.  
  3136.   Set Exit 0
  3137.   Confirm “Replace files with the same name? ”
  3138.   If {Status} == 0
  3139.     Duplicate -y Source:≈ Destination:
  3140.   End
  3141.   Set Exit 1
  3142.  
  3143.   The following confirmation dialog box will be displayed:
  3144.  
  3145. æKY Continue
  3146. æC        Continue -- continue with next iteration of For or Loop
  3147.  
  3148. Continue [If expression]
  3149. Status codes returned:
  3150.    0   No errors.
  3151.   –3   Error in parameters, or Continue not within For…End or Loop…End.
  3152.   –5   Invalid expression.
  3153.  
  3154.                            Description
  3155.  
  3156.   If expression is nonzero, Continue terminates this iteration of the
  3157.   immediately enclosing For or Loop command and continues with the
  3158.   next iteration. (Null strings evaluate to zero.) If the “If expression”
  3159.   clause is omitted, the Continue is unconditional. If no further iterations
  3160.   are possible, the For or Loop is terminated. (For a definition of
  3161.   expression, see the Evaluate command.)
  3162.  
  3163.  
  3164.                              Examples
  3165.  
  3166.   Set Exit 0
  3167.   Set list “”
  3168.   For file In `files -t TEXT`
  3169.     Confirm -t “Print file {file}?”
  3170.     Set SaveStatus {Status}
  3171.     Continue If {SaveStatus} == 4 # No
  3172.     Break If {SaveStatus} == 5 # Cancel
  3173.     Set list “{list} '{file}'” # YesEnd
  3174.   End
  3175.   Print {PrintOptions} {list}
  3176.   Set Exit 1
  3177.  
  3178.   In this example, the Continue command is executed if the user selects
  3179.   No (status value 4). The Continue causes the current file to be skipped, but
  3180.   processing continues with the next file in the list.
  3181.  
  3182.   (For a full explanation of this example, refer to the Confirm command.)
  3183.  
  3184.  
  3185.                              See also 
  3186.  
  3187.   For, Loop, Break, and If commands.
  3188.  
  3189.   Evaluate command, for a description of expressions.
  3190.  
  3191.   “Structured Commands” in Chapter 5.
  3192.  
  3193. æKY Copy
  3194. æC                  Copy -- copy selection to Clipboard
  3195.  
  3196. Copy [-c count] selection [window]
  3197.  -c count                # copy the nth selection, where n = count
  3198.  
  3199. Status codes returned:
  3200.   0    At least one instance of the selection was found.
  3201.   1    Syntax error.
  3202.   2    Any other error.
  3203.  
  3204.                            Description
  3205.  
  3206.   Finds selection in the specified window and copies it to the Clipboard,
  3207.   replacing the previous contents of the Clipboard. If no window is
  3208.   specified, the command operates on the target window (the second
  3209.   window from the front). It’s an error to specify a window that doesn’t
  3210.   exist.
  3211.  
  3212.   For a definition of selection, see “Selections” in Chapter 6 of the MPW
  3213.   manual; a summary
  3214.   of the selection syntax is contained in Appendix B.
  3215.  
  3216.     • Note: To copy files, use the Duplicate command.
  3217.  
  3218.  
  3219.                              Examples
  3220.  
  3221.   Copy §
  3222.  
  3223.   Copies the current selection to the Clipboard. This command is like
  3224.   the Copy command in the Edit menu, except that the action takes place
  3225.   in the target window.
  3226.  
  3227.   Copy /BEGIN/:/END/
  3228.  
  3229.   Selects everything from the next BEGIN through the following END
  3230.   and copies this selection to the Clipboard.
  3231.  
  3232.  
  3233.                              See also 
  3234.  
  3235.   Cut and Paste commands.
  3236.  
  3237.   “Selections” in Chapter 6 and Appendix B.
  3238.  
  3239.  
  3240. æKY Count
  3241. æC                  Count -- count lines and characters
  3242.  
  3243. Count [-l] [-c] [file…]  < file > counts
  3244.  -l                      # write only line counts
  3245.  -c                      # write only character counts
  3246.  
  3247. Status codes returned:
  3248.   0    No errors.
  3249.   1    Error in parameters.
  3250.   2    Unable to open input file.
  3251.  
  3252.                            Description
  3253.  
  3254.   Counts the lines and characters in its input and writes the results
  3255.   to standard output. If no files are specified, standard input is
  3256.   read. If more than one file is specified, separate counts are printed
  3257.   for each file, one per line and preceded by the filename. A total
  3258.   is printed following the list.
  3259.  
  3260.  
  3261.                              Examples
  3262.  
  3263.   Count MakeFile.c Count.c
  3264.  
  3265.   Displays line counts and character counts in the form
  3266.  
  3267.   MakeFile.c 43 981
  3268.   Count.c 153 3327
  3269.   Total 196 4303
  3270.  
  3271.   Files | Count -l
  3272.  
  3273.   Displays the total number of files and directories in the current
  3274.   directory.
  3275.  
  3276.   Count -l §
  3277.  
  3278.   Displays the number of lines selected in the target window.
  3279.  
  3280.     • Note: The source code for Count is included in the CExamples
  3281.     folder in the file Count.c, as part of MPW C.
  3282.  
  3283. æKY CPlus
  3284. æC                CPlus -- script to compile C++ source
  3285.  
  3286. CPlus [option…] [file…] < file > intermediate output ≥ progress
  3287.     -a                      # force ANSI-style intermediate C code (default)
  3288.     -a0                     # force K&R-style (pre-ANSI) intermediate C code
  3289.     -a1                     # force ANSI-style intermediate C code (default)
  3290.     -b                      # put string constants into code and generate PC-relative references
  3291.     -b2                     # implies '-b' above, and allows string constants to be overlaid
  3292.     -b3                     # overlaid string constants in code (but not PC-relative refs.)
  3293.     -c                      # intermediate code to standard output; no object file
  3294.     -d name                 # equivalent to: #define name 1
  3295.     -d name=string          # equivalent to: #define name string
  3296.     -e                      # write preprocessor results to output
  3297.     -e2                     # implies '-e' above, and strips comments
  3298.     -elems881               # generate MC68881 code for transcendentals
  3299.     -f filename             # act as if input comes from named file when it actually is from stdin 
  3300.     -f1                     # send text version of C code to C compiler (no token stream)
  3301.     -i directory            # search for includes in directory
  3302.     -m                      # generate 32-bit references for data (less efficient code)
  3303.     -mbg ch8                # MPW 2.0 compatible macsbug symbols
  3304.     -mbg off                # no macsbug symbols in the code (link/unlk only if necessary)
  3305.     -mbg on|full            # full macsbug symbols
  3306.     -mbg <n>                # macsbug symbols to length <n> (<n> can be 0..63)
  3307.     -mc68020                # generate MC68020 code 
  3308.     -mc68881                # generate MC68881 code for arithmetic operations
  3309.     -mtbl0                  # suppress output of method tables for Object Pascal Classes
  3310.     -mtbl1                  # force output of method tables for Object Pascal Classes
  3311.     -n                      # Turn pointer assignment incompatibilty errors into warnings
  3312.     -o objname              # generate code in file or directory objname
  3313.     -p                      # write progress information to diagnostic
  3314.     -s segment              # generate code in segment
  3315.     -sym off                # no SADE records
  3316.     -sym on|full            # full SADE records; can modify with [,nolines] [,notypes] [,novars]
  3317.     -t                      # write C compilation time to diagnostic
  3318.     -u name                 # equivalent to: #undef name
  3319.     -vtbl0                  # suppress output of virtual tables for ordinary class
  3320.     -vtbl1                  # force output of virtual tables for ordinary class
  3321.     -vtbl2                  # new improved output algorithm for virtual tables
  3322.     -w                      # suppress warnings
  3323.     -w1                     # generate additional warnings from CFront
  3324.     -w3                     # passed through to C compiler (supresses unused warnings)
  3325.     -y directory            # create temporary files in directory
  3326.     -z0                     # force 'inline' functions to be non-inline
  3327.     -z3                     # supress name encoding of local vars and struct members (default)
  3328.     -z4                     # encode names of local vars and struct members
  3329.     -z6                     # force enums always to be int variables
  3330.     -z7                     # relax requirement on static class member initialization 
  3331.  
  3332. Status codes returned:
  3333.   0    Successful completion.
  3334.   1    Errors occurred.
  3335.  
  3336.                            Description
  3337.  
  3338.   CPlus compiles the specified C++ source file. Compiling file Name.cp
  3339.   creates object file Name.cp.o. (By convention, C++ source filenames
  3340.   end in a “.cp” suffix.) If no filenames are specified, standard input
  3341.   is compiled and the object file “c.o” is created.
  3342.  
  3343.   (Note that SADE object file information cannot be generated for standard
  3344.   input source files.)
  3345.  
  3346.   The CPlus script activates, in turn, CFront, and the MPW C Compiler.
  3347.   (CFront consists of two components: a C preprocessor and a C++ to
  3348.   C translator.)
  3349.  
  3350.   See the MPW 3.0 C++ Reference Manual for details of the MPW C++ language
  3351.   definition.
  3352.  
  3353.  
  3354.                              Examples
  3355.  
  3356.   cplus -p Sample.c
  3357.  
  3358.   Compiles Sample.c, producing the object file Sample.c.o. Writes progress
  3359.   information to diagnostic output. (Sample.c is found in Examples:CPlusExamples.)
  3360.  
  3361.  
  3362.                              See also 
  3363.  
  3364.   MPW 3.0 C Reference, MPW C++ Reference.
  3365.  
  3366. æKY CreateMake
  3367. æC                CreateMake -- create a simple makefile
  3368.  
  3369. CreateMake [ -Application [ -c creator ] | -Tool | -DA | SIOW
  3370.          -CR -m mainEntryPoint -rt resourceType | -SIOW 
  3371.          [ -t type ] [ -c creator ] ] [-sym on]
  3372.          [-mc68020 | -mc68881 | -elems881] program file…
  3373.     -Application        # create an Application (default)
  3374.     -c creator          # optional Creator for Application or Code Resource
  3375.     -Tool               # create a Tool
  3376.     -DA                 # create a Desk Accessory
  3377.     -CR                 # create a Code Resource
  3378.     -SIOW               # create a Simple Input/Output Window
  3379.     -m mainEntryPoint   # required Main Entry Point for Code Resource
  3380.     -rt resourceType    # required Resource Type for Code Resource
  3381.     -t type             # optional File Type for Code Resource
  3382.     -sym on             # include SADE information in the object file
  3383.     -mc68020            # generate 68020 instructions
  3384.     -mc68881            # generate 68881 instructions for elementary operations
  3385.     -elems881           # generate 68881 instructions for transcendental functions
  3386.  
  3387. Status codes returned:
  3388.   0    Successful completion.
  3389.   1    Parameter or option error.
  3390.  
  3391.                            Description
  3392.  
  3393.   CreateMake creates a simple makefile for building the specified program.
  3394.   The parameter program is the name of the program. Makefile program.make
  3395.   is created. The list of files includes both source and library files.
  3396.   Source files may be written in any combination of assembly language
  3397.   (suffix “.a”), C (“.c”), C++ (“.cp”), Pascal (“.p”), and/or Rez (“.r”).
  3398.  
  3399.   You can also specify Library files (suffix “.o”). Link the program
  3400.   with these files. CreateMake automatically links with the library
  3401.   files listed below. It is not necessary to specify these files as
  3402.   parameters to CreateMake.
  3403.  
  3404.   You can create Makefiles for building applications (the default),
  3405.   desk accessories, and tools.
  3406.  
  3407.   CreateMake generates commands that link the program with the following
  3408.   set of MPW libraries:
  3409.  
  3410.     • Inside Macintosh Interfaces
  3411.         {Libraries}Interface.o
  3412.     • Runtime support—one of the following:
  3413.         {Libraries}Stubs.o # a tool is to be built
  3414.         {Libraries}Runtime.o # no C object files
  3415.         {CLibraries}CRuntime.o # any C object files
  3416.     • C Libraries—if any source is in C
  3417.         {CLibraries}StdCLib.o
  3418.         {CLibraries}CSANELib.o
  3419.         {CLibraries}Math.o
  3420.         {CLibraries}CInterface.o
  3421.     • C Libraries—if any source is in C++
  3422.         {CLibraries}CPlusStreams.o # a tool is to be built
  3423.         {CLibraries}CPlusStubs.o # a DA is to be built
  3424.         {CLibraries}CSANELib.o
  3425.         {CLibraries}Math.o
  3426.         {CLibraries}CInterface.o
  3427.     • Pascal Libraries—if any source is in Pascal
  3428.         {PLibraries}PasLib.o
  3429.         {PLibraries}SANELib.o
  3430.     • For tools:
  3431.         {Libraries}ToolLibs.o
  3432.     • For desk accessories:
  3433.         {Libraries}DRVRRuntime.o
  3434.  
  3435.   CreateMake does not include dependencies on include files and USES
  3436.   files in the makefile. Libraries other than those listed above are
  3437.   not included in the Link command generated by CreateMake, unless
  3438.   specified as parameters. CreateMake is used to implement the Create
  3439.   Build Commands item in the Build menu.
  3440.  
  3441.  
  3442.                              Examples
  3443.  
  3444.   CreateMake -tool count count.c count.r
  3445.  
  3446.   Creates the makefile Count.make containing commands for building
  3447.   the tool Count from the source files Count.c and Count.r. The makefile
  3448.   is similar to the following:
  3449.  
  3450.   # File: count.make
  3451.   # Target: count
  3452.   # Sources: count.c count.r
  3453.   # Created: Thursday, June 2, 1988 5:33:38 PM
  3454.  
  3455.   count.c.o ƒ count.make count.c
  3456.       C count.c
  3457.  
  3458.   count ƒƒ count.make count.r
  3459.       Rez count.r -append -o count
  3460.  
  3461.   SOURCES = count.c count.r
  3462.   OBJECTS = count.c.o
  3463.  
  3464.   count ƒƒ count.make {OBJECTS}
  3465.  
  3466.       Link -w -t MPST -c ‘MPS ’ ∂
  3467.           “{Libraries}”Stubs.o ∂
  3468.           “{CLibraries}”CRuntime.o ∂
  3469.           “{Libraries}”Interface.o ∂
  3470.           “{CLibraries}”StdCLib.o ∂
  3471.           “{CLibraries}”CSANELib.o ∂
  3472.           “{CLibraries}”Math.o ∂
  3473.           “{CLibraries}”CInterface.o ∂
  3474.           “{Libraries}”ToolLibs.o ∂
  3475.           “{OBJECTS}” ∂
  3476.           -o count
  3477.  
  3478.  
  3479.                              See also 
  3480.  
  3481.   BuildMenu and BuildProgram commands.
  3482.  
  3483.   “Building a Program: An Introduction” in Chapter 2.
  3484.  
  3485. æKY CreateMakeIIGS
  3486. æC      CreateMakeIIGS -- creates Make files that build programs
  3487. CreateMakeIIGS [option…] program file… 
  3488.  -Application            # create an Apple IIGS Application (default)
  3489.  -CDA                    # create an Apple IIGS Classic Desk Accessory
  3490.  -NDA                    # create an Apple IIGS New Desk Accessory
  3491.  -Tool                   # create an APW Tool
  3492.  -s stacksize            # set the stack size
  3493.  -d                      # generate DuplicateIIGS command after link
  3494.  
  3495. æKY Cut
  3496. æC           Cut -- copy selection to Clipboard and delete it
  3497.  
  3498. Cut [-c count] selection [window]
  3499.  -c count                # cut the next count selections
  3500.  
  3501. Status codes returned:
  3502.   0    At least one instance of the selection was found.
  3503.   1    Syntax error.
  3504.   2    Any other error.
  3505.  
  3506.                            Description
  3507.  
  3508.   Finds selection in the specified window, copies its contents to the
  3509.   Clipboard, and then deletes the selection. If no window is specified,
  3510.   the command operates on the target window (the second window from
  3511.   the front). It’s an error to specify a window that doesn’t exist.
  3512.  
  3513.   For a definition of selection, see “Selections” in Chapter 6 of the MPW
  3514.   manual; a summary of the selection syntax is contained in Appendix B.
  3515.  
  3516.  
  3517.                              Examples
  3518.  
  3519.   Cut §
  3520.  
  3521.   Cuts the current selection in the target window. (This is the same
  3522.   as the Cut menu item, except that it operates on the target window
  3523.   rather than the active window.)
  3524.  
  3525.   Cut /BEGIN/:/END/
  3526.  
  3527.   Selects everything from the next BEGIN through the following END,
  3528.   copies the contents of the selection to the Clipboard, and then deletes
  3529.   the selection.
  3530.  
  3531.  
  3532.                              See also 
  3533.  
  3534.   Clear, Copy, and Paste commands.
  3535.  
  3536.   “Selections” in Chapter 6 and in Appendix B.
  3537.  
  3538. æKY Date
  3539. æC                    Date -- write the date and time
  3540.  
  3541. Date ([-a | -s] [-d | -t] [-c seconds]) | [-n] > date
  3542.   -a                       # abbreviated date (e.g. Wed, Jun 18, 1986)
  3543.   -s                       # short date (e.g. 6/18/86)
  3544.   -d                       # write date only
  3545.   -t                       # write time only
  3546.   -c seconds               # write date corresponding to seconds
  3547.   -n                       # write seconds since January 1, 1904
  3548.  
  3549. Status codes returned:
  3550.   0    No error.
  3551.   1    Syntax error.
  3552.  
  3553.                            Description
  3554.  
  3555.   Writes the current date and time to standard output in a variety
  3556.   of standard and user-specified formats. Date arithmetic is supported
  3557.   with the -n and -c options that work with the number of seconds since
  3558.   January 1, 1904. With no options the Date output has this form: Thursday,
  3559.   August 30, 1988 10:45:51 A.M.
  3560.  
  3561.  
  3562.                              Examples
  3563.  
  3564.   Date
  3565.  
  3566.   returns the date in the form
  3567.   Friday, February 14, 1988 10:34:25 PM
  3568.  
  3569.   Date -a
  3570.  
  3571.   returns
  3572.   Fri, Feb 14, 1988 10:34:25 PM
  3573.  
  3574.   Date -s -d
  3575.  
  3576.   returns
  3577.   2/14/86
  3578.  
  3579.   Set starttime `Date -n`
  3580.   BuildMyProgram
  3581.   Set endTime `Date -n`
  3582.   Echo Total time for BuildMyProgram ∂
  3583.   `Evaluate {endTime} - {startTime}`
  3584.  
  3585.   This example demonstrates how date arithmetic may be used to show
  3586.   how long a tool or script takes to execute.
  3587.  
  3588. æKY Delete
  3589. æC                Delete -- delete files and directories
  3590.  
  3591. Delete [-y | -n | -c] [-i] [-p] name…  ≥ progress
  3592.  -y                # delete directory contents (avoids dialog)
  3593.  -n                # don't delete directory contents (avoids dialog)
  3594.  -c                # cancel if a directory is to be deleted (avoids dialog)
  3595.  -i                # ignore errors (no diagnostics)
  3596.  -p                # write progress information to diagnostics
  3597.   
  3598. Status codes returned:
  3599.   0    All specified objects were deleted (except for any directories skipped 
  3600.        with the -n option).
  3601.   1    Syntax error.
  3602.   2    An error occurred during the delete.
  3603.   4    Cancel was selected or implied by the -c option.
  3604.  
  3605.                            Description
  3606.  
  3607.   Deletes file or directory name. If name is a directory, name and
  3608.   its contents (including all subdirectories) are deleted.
  3609.  
  3610.   Before deleting directories, a dialog box will request confirmation
  3611.   for the deletion. Use the -y, -n, or -c options in scripts to avoid
  3612.   this interaction. Be sure to see the warning at the end of this section.
  3613.  
  3614.  
  3615.                              Examples
  3616.  
  3617.   Delete HD:MPW:≈.c
  3618.  
  3619.   Deletes all items in the MPW folder that end in “.c”. (Recall that
  3620.   the Shell first replaces the parameter “≈.c” with a list of filenames
  3621.   matching the pattern—the Delete command then deletes each of these
  3622.   files.)
  3623.  
  3624.   Warning Beware of potentially disastrous typographical mistakes such
  3625.   as the following:
  3626.  
  3627.   Delete ≈ .c
  3628.  
  3629.   Note the space after “≈”—this space causes “≈” and “.c” to be treated
  3630.   as two separate parameters. In this case, Delete deletes all files
  3631.   in the current directory and also attempts to delete a file named
  3632.   “.c”.
  3633.  
  3634.   Also note that the following command deletes everything:
  3635.  
  3636.   Delete ≈:
  3637.  
  3638.   That is, the filename pattern ≈: expands to the names of all volumes
  3639.   online (including the startup volume!).
  3640.  
  3641.   When deleting files en masse, it’s a good practice to use the Echo
  3642.   command to verify the action of the filename generation operators;
  3643.   for example,
  3644.  
  3645.   Echo ≈.c
  3646.  
  3647.  
  3648.                              See also 
  3649.  
  3650.   Clear command (for deleting selections).
  3651.  
  3652.   “Filename Generation” in Chapter 5.
  3653.  
  3654. æKY DeleteMenu
  3655. æC        DeleteMenu -- delete user-defined menus and menu items
  3656.  
  3657. DeleteMenu [menuName [itemName]]
  3658.  
  3659. Status codes returned:
  3660.   0    No errors.
  3661.   1    Syntax error.
  3662.   2    Other errors.
  3663.  
  3664.                            Description
  3665.  
  3666.   Deletes the user-defined item itemName in the menu menuName. If itemName
  3667.   is omitted, all user-defined items for menuName are deleted.
  3668.  
  3669.   Caution If itemName and menuName are both omitted, all user-defined
  3670.   items are deleted. Menu items that haven’t been added with AddMenu
  3671.   can’t be deleted with DeleteMenu.
  3672.  
  3673.  
  3674.                              Examples
  3675.  
  3676.   DeleteMenu File
  3677.  
  3678.   Deletes all user-defined items from the File menu.
  3679.  
  3680.  
  3681.                              See also 
  3682.  
  3683.   AddMenu command. 
  3684.  
  3685. æKY DeleteNames
  3686. æC           DeleteNames -- delete user-defined symbolic names
  3687.  
  3688. DeleteNames [-u user] [-private] [-project project] [-public] [-r] [names… | -a]
  3689.   -u user                 # name of current user
  3690.   -private                # delete private names
  3691.   -project project        # name of project that contains the files
  3692.   -public                 # delete public names
  3693.   -r                      # delete names recursively
  3694.   -a                      # delete all names
  3695.  
  3696. Status codes returned:
  3697.   0    No errors.
  3698.   1    Syntax error.
  3699.   2    Error in processing.
  3700.  
  3701.                            Description
  3702.  
  3703.   Delete symbolic names used to represent a set of revisions under
  3704.   Projector. You can create symbolic names by using the NameRevisions
  3705.   command.
  3706.  
  3707.   You can use the -log option of the ProjectInfo command to see which
  3708.   names have been deleted and what their values were.
  3709.  
  3710.   See Chapter 7 of MPW Manual for complete definitions of the terms and 
  3711.   symbols used in Projector commands.
  3712.  
  3713.  
  3714.                              Examples
  3715.  
  3716.   Suppose you have created a Name “Work” that is expanded to the
  3717.   files file.c and interactive.c using the command
  3718.  
  3719.   NameRevisions Work file.c interactive.c
  3720.  
  3721.   Then:
  3722.  
  3723.   DeleteNames Work
  3724.  
  3725.   removes “Work” from the list of symbolic names.
  3726.  
  3727.  
  3728.                              See also 
  3729.  
  3730.   NameRevisions, ProjectInfo.
  3731.  
  3732.  
  3733. æKY DeletePane
  3734. æC                          DeletePane --  delete panes from the window
  3735.  
  3736. DeletePane [-p paneSpec | -a] [window]
  3737.      -p paneSpec            # choose a  pane to delete
  3738.      -a                     # reset the window to one pane
  3739.  
  3740.       Note: paneSpec is an alternating catenation of strings of the 
  3741.       form cm and rn, where m is a column ordinal and n is a row ordinal.
  3742.  
  3743.  
  3744. æKY DeleteRevisions
  3745. æC  DeleteRevisions -- delete previous revisions of files in a project
  3746.  
  3747. DeleteRevisions [-u user] [-project project] [-file] [-y] revision…
  3748.     -u user                 # name of current user
  3749.     -project project        # name of project that contains the files
  3750.     -file                   # deletes the file and all its revisions
  3751.     -y                      # delete the file/revision (avoids dialog)
  3752.  
  3753. Status codes returned:
  3754.   0    No errors.
  3755.   1    Syntax error.
  3756.   2    Error in processing.
  3757.   3    System error.
  3758.  
  3759.                            Description
  3760.  
  3761.   Delete old revisions by specifying the oldest revision that you want
  3762.   to keep. All prior revisions are deleted. Delete all revisions on
  3763.   a branch by naming the branch or branches in the named files under
  3764.   Projector. It is an error to try to delete a revision that is currently
  3765.   checked out for modification.
  3766.  
  3767.   Revision is either a filename, a filename followed by a comma and
  3768.   a revision number, or a filename followed by a comma and a branch
  3769.   name (such as
  3770.  
  3771.   foo.c,22a).
  3772.  
  3773.   You can use the -file option to remove the file and all of its revisions
  3774.   from the project.
  3775.  
  3776.   s Warning DeleteRevisions permanently removes the revisions and branches
  3777.   specified. They cannot be recovered.  s
  3778.  
  3779.   You can use the -log option of the ProjectInfo command to see which
  3780.   revisions have been deleted and who deleted them.
  3781.  
  3782.   See Chapter 7 of the MPW Manual for complete definitions of the terms and 
  3783.   symbols used in Projector commands.
  3784.  
  3785.  
  3786.                              Examples
  3787.  
  3788.   DeleteRevisions -project Zoom∫Utilities∫MyProject file.c
  3789.  
  3790.   This example deletes all revisions except the latest in file.c in
  3791.   the named project.
  3792.  
  3793.   DeleteRevisions file.c,22a3
  3794.  
  3795.   This example deletes all revisions on branch 22a before revision
  3796.   3 of file.c.
  3797.  
  3798.   DeleteRevisions file.c,22a
  3799.  
  3800.   This command deletes all the revisions on branch 22a in file.c of
  3801.   the current project.
  3802.  
  3803.   DeleteRevisions -file file.c
  3804.  
  3805.   This command deletes the file file.c and all of its revisions from
  3806.   the current project.
  3807.  
  3808.  
  3809.                              See also 
  3810.  
  3811.   NameRevisions, ProjectInfo.
  3812.  
  3813. æKY DeRez
  3814. æC                     DeRez -- resource decompiler
  3815.  
  3816. DeRez [option…] resourceFile [file…]  > description ≥ progress
  3817.     -c[ompatible]           # generate output compatible with Rez 1.0
  3818.     -e[scape]               # don't escape chars < $20 or > $D8
  3819.     -d[efine] name[=value]  # equivalent to #define name [value]
  3820.     -i[nclude] pathname     # search this path when looking for #include files
  3821.     -m[axstringsize] n      # write strings n characters per line
  3822.     -only typeExpr          # process only resources of this type
  3823.     -p[rogress]             # write progress information to diagnostics
  3824.     -rd                     # suppress warnings for redeclared types
  3825.     -s[kip] typeExpr        # skip resources of this type
  3826.     -u[ndef] name           # equivalent to #undef name
  3827.  
  3828.     Note: A typeExpr may have one of these forms:
  3829.           type
  3830.         "'type'(id)"
  3831.         "'type'(id:id)"
  3832.         "'type'(∂"name∂")"
  3833.  
  3834. Status codes returned:
  3835.   0    No errors.
  3836.   1    Error in parameters.
  3837.   2    Syntax error in file.
  3838.   3    I/O or program error.
  3839.  
  3840.                            Description
  3841.  
  3842.   Creates a text representation (resource description) of the resource
  3843.   fork of resourceFile, according to the resource type declarations
  3844.   in the resource description file(s). The resource description is
  3845.   written to standard output.
  3846.  
  3847.   A resource description file is a file of type declarations in the
  3848.   format used by the resource compiler, Rez. The type declarations
  3849.   for standard Macintosh resources are contained in the files Types.r
  3850.   and SysTypes.r, contained in the {RIncludes} folder. If no resource
  3851.   description file is specified, the output consists of data statements
  3852.   giving the resource data in hexadecimal form, without any additional
  3853.   format information.
  3854.  
  3855.   If the output of DeRez is used as input to Rez, with the same resource
  3856.   description files, it produces the same resource fork that was originally
  3857.   input to DeRez. DeRez is not guaranteed to be able to run a declaration
  3858.   backwards; if it can’t, it produces a data statement instead of the
  3859.   appropriate resource statement.
  3860.  
  3861.   DeRez ignores all include (but not #include), read, data, change,
  3862.   delete, and resource statements found in the resourceDescriptionFile.
  3863.   (It still parses these statements for correct syntax.)
  3864.  
  3865.   For the format of resource type declarations, see Chapter 11 and
  3866.   Appendix D of the MPW manual.
  3867.  
  3868.  
  3869.                              Examples
  3870.  
  3871.   DeRez “{ShellDirectory}MPW Shell” -only MENU Types.r
  3872.  
  3873.   Displays all of the 'MENU' resources used by the MPW Shell. The type
  3874.   definition for 'MENU' resources is found in the file Types.r.
  3875.  
  3876.   DeRez HD:OS:System SysTypes.r ∂
  3877.   -only “'DRVR' (∂“\\0x00Scrapbook∂”)”
  3878.  
  3879.   Decompiles the Scrapbook desk accessory in the copy of the System
  3880.   file that’s located in directory HD:OS:. (The type definition for
  3881.   'DRVR' resources is found in the file SysTypes.r.)
  3882.  
  3883.  
  3884.                              See also 
  3885.  
  3886.   Rez and RezDet commands.
  3887.  
  3888.   Chapter 11.
  3889.  
  3890.   Type declaration files in RIncludes folder:
  3891.  
  3892.     • Types.r
  3893.  
  3894.     • SysTypes.r
  3895.  
  3896.     • MPWTypes.r
  3897.  
  3898.     • Pict.r
  3899.  
  3900. æKY DeRezIIGS
  3901. æC                DeRezIIGS -- resource decompiler
  3902. DeRezIIGS [option…] resourceFile [file…]  > description ≥ progress
  3903.  -c[ompatible]           # generate output compatible with Rez 1.0
  3904.  -e[scape]               # don't escape chars < $20 or > $D8
  3905.  -d[efine] name[=value]  # equivalent to #define name [value]
  3906.  -i[nclude] pathname     # search this path when looking for #include files
  3907.  -m[axstringsize] n      # write strings n characters per line
  3908.  -only typeExpr          # process only resources of this type
  3909.  -p[rogress]             # write progress information to diagnostics
  3910.  -rd                     # suppress warnings for redeclared types
  3911.  -s[kip] typeExpr        # skip resources of this type
  3912.  -u[ndef] name           # equivalent to #undef name
  3913.  
  3914.  Note: A typeExpr may have one of these forms:
  3915.      type
  3916.    "'type'(id)"
  3917.    "'type'(id:id)"
  3918.    "'type'(∂"name∂")"
  3919. æKY Directory
  3920. æC           Directory -- set or write the default directory
  3921.  
  3922. Directory [-q | directory]   > directory
  3923.  -q                      # don't quote directories with special characters
  3924.  
  3925. Status codes returned:
  3926.   0    No error.
  3927.   1    Directory not found, command aborted, or parameter error.
  3928.  
  3929.                            Description
  3930.  
  3931.   If specified, directory becomes the new default directory. Otherwise
  3932.   the pathname of the current default directory is written to standard
  3933.   output.
  3934.  
  3935.   If directory is a leafname, the command searches for directory in
  3936.   the directories listed in the Shell variable {DirectoryPath}. If
  3937.   the variable is undefined, the command looks in the current directory.
  3938.  
  3939.     • Note: To display a directory’s contents, use the Files command.
  3940.  
  3941.  
  3942.                              Examples
  3943.  
  3944.   Directory
  3945.  
  3946.   Writes the pathname of the current directory to standard output.
  3947.  
  3948.   Directory HD:MPW:Examples:
  3949.  
  3950.   Sets the default directory to the folder Examples in the folder MPW
  3951.   on the volume HD. The final colon is optional.
  3952.  
  3953.   Directory Reports:
  3954.  
  3955.   Sets the default directory to the volume Reports. Note that volume
  3956.   names must end in a colon.
  3957.  
  3958.   Directory :Include:Pascal:
  3959.  
  3960.   Sets the default directory to the folder Pascal in the folder Include
  3961.   in the current default directory.
  3962.  
  3963.   Set DirectoryPath “:, {MPW}, {MPW}Projects:”
  3964.  
  3965.   Directory Tools
  3966.  
  3967.   Sets the directory to the Tools directory. The current directory
  3968.   is searched first, followed by the {MPW} directory, and finally by
  3969.   the {MPW} Projects directory. If there is no Tools directory in your
  3970.   current directory, the directory is set to {MPW}Tools.
  3971.  
  3972.  
  3973.                              See also 
  3974.  
  3975.   “File and Window Names” in Chapter 4.
  3976.  
  3977.   Files, NewFolder, and SetDirectory commands.
  3978.  
  3979. æKY DirectoryMenu
  3980. æC        DirectoryMenu [directory…] -- create the Directory menu
  3981.  
  3982. Status code returned:
  3983.    0    no errors always returned.
  3984.  
  3985.                            Description
  3986.  
  3987.   Creates the Directory menu shown here. The optional directory… parameter
  3988.   specifies the initial list of directories that appears in the menu.
  3989.   The menu items are described in Chapter 3 of the MPW manual.
  3990.  
  3991.   The lower section of the Directory menu contains a list of directories.
  3992.   Initially this list consists of the parameters to DirectoryMenu.
  3993.   As other directories become the current directory (using the Set
  3994.   Directory menu item or the SetDirectory command), they are added
  3995.   to the list.
  3996.  
  3997.  
  3998.                              Examples
  3999.  
  4000.   DirectoryMenu `(Files -d -i {MPW}Examples:≈) ≥ Dev:Null` `Directory`
  4001.  
  4002.   Creates the Directory menu. Directories in directory {MPW} that match
  4003.   the pattern Examples:≈ will be included in the Directory menu, along
  4004.   with the current directory.
  4005.  
  4006.   This DirectoryMenu command should be included in your UserStartup
  4007.   file to install the Directory menu. You might replace the Examples
  4008.   directories and the default directory with your favorite list of
  4009.   directories.
  4010.  
  4011. æKY DoIt
  4012. æC       DoIt -- highlight and execute a series of shell commands
  4013.  
  4014. DoIt (CommandFile [-echo] [-dump]) | [-selection]
  4015.  -echo                   # echo commands before execution
  4016.  -dump                   # dump unexecuted commands after error
  4017.  -selection              # execute command in the current selection
  4018.  
  4019. Status codes returned:
  4020.   0    No errors.
  4021.   1    Syntax error.
  4022.  
  4023.                            Description
  4024.  
  4025.   DoIt will execute a series of Shell commands, highlighting each command
  4026.   as it is executed. The commands can be either in a file or in the
  4027.   current selection of the active window. If a CommandFile is passed
  4028.   to DoIt, the file is opened (as the active window) and each command
  4029.   is executed. The window is closed when all commands have been processed.
  4030.  
  4031.   This command will not work for a series of commands that contains
  4032.   structured commands such as If statements or Loops.
  4033.  
  4034.  
  4035.                              Examples
  4036.  
  4037.   Backup -from “HD:Src:” -to “Backup:Src” -a -r -c > out
  4038.  
  4039.   DoIt out
  4040.  
  4041.   The above command will highlight and execute all the Duplicate commands
  4042.   generated by the Backup command. In this way you can see progress
  4043.   as the files are being duplicated.
  4044.  
  4045.   AddMenu DoIt “DoIt Selection” “DoIt -selection”
  4046.  
  4047.   The above AddMenu command will create a menu that can be used to
  4048.   highlight and execute the current selection. This could be used on
  4049.   a series of commands generated by Make or Backup that were written
  4050.   to the Active window. Simply select the commands and select the “DoIt
  4051.   Selection” menu item.
  4052.  
  4053.   Make > make.out
  4054.  
  4055.   DoIt -dump make.out
  4056.  
  4057.   This DoIt command will open the make.out file and highlight and execute
  4058.   each of the commands generated by the previous make command. In this
  4059.   way you can see progress as the files are being compiled and linked.
  4060.   If an error occurs (for instance, in one of the compiles), that compile
  4061.   command along with the rest of the commands in the make.out will
  4062.   be written to the WorkSheet. At this point you could fix the error
  4063.   (in the source file), select the “ToDo” marker (which would select
  4064.   the remaining commands), and select the “DoIt Selection” menu item
  4065.   to execute the remaining commands.
  4066.  
  4067. æKY DumpCode
  4068. æC              DumpCode -- write formatted CODE resources
  4069.  
  4070. DumpCode [option…] resourceFile  > dump ≥ progress
  4071.     -a                      # Show offsets from beginning of segment
  4072.     -d                      # don't dump object code
  4073.     -di                     # don't dump data initialization info
  4074.     -h                      # don't write headers (offsets, hex, etc.)
  4075.     -jt                     # don't dump jump table
  4076.     -n                      # dump only resource names
  4077.     -p                      # write progress information to diagnostics
  4078.     -r byte1[,byte2]        # dump code from address byte1 (through byte2)
  4079.     -ri                     # don't dump a5- and segment-relocation info
  4080.     -rt type[=id]           # dump only resources with this type (and id)
  4081.     -s name                 # dump only resource with this name
  4082.  
  4083. Status codes returned:
  4084.   0    No problem.
  4085.   1    Syntax error.
  4086.   2    Fatal error.
  4087.  
  4088.                            Description
  4089.  
  4090.   Disassembles object code that is stored in resources such as 'CODE',
  4091.   'DRVR', and 'PDEF'. DumpCode reads from the resource fork of the
  4092.   specified file and writes the formatted assembly code to standard
  4093.   output. The default formatting convention is to disassemble the code
  4094.   and to display the corresponding bytes in hexadecimal and ASCII.
  4095.  
  4096.   The default behavior of DumpCode is to dump all the 'CODE' resources
  4097.   from a program file. The -rt option can be used to dump resources
  4098.   of other types, such as drivers and desk accessories.
  4099.  
  4100.   Some conventions about executable code resources are built into DumpCode
  4101.   and affect the formatted output in special ways:
  4102.  
  4103.     • 'CODE' resources with ID 0 are formatted as a jump table (unloaded
  4104.     format).
  4105.  
  4106.     • Other 'CODE' resources have information about jump table entries
  4107.     in the first four bytes.
  4108.  
  4109.     • 'DRVR' resources have a special format at the beginning of
  4110.     the resource.
  4111.  
  4112.   In addition, you can direct DumpCode to give a symbolic dump of data
  4113.   initialization descriptors and initial values.
  4114.  
  4115.  
  4116.                              Examples
  4117.  
  4118.   DumpCode Sample > SampleDump
  4119.  
  4120.   Formats the 'CODE' resources in the file Sample, writing the output
  4121.   to the file SampleDump. The output has this format:
  4122.  
  4123.   File: sample, Resource 3, Type: CODE, Name: _DataInit
  4124.   Offset of first jump table entry: $00000018
  4125.   Segment is $000000D2 bytes long, and uses 1 jump table entry
  4126.   000000: 48E7 FFF0 'H...' MOVEM.L D0-D7/A0-A3,-(A7)
  4127.   000004: 4247 'BG' CLR.W D7
  4128.   000006: 4EAD 0032 'N..2' JSR $0032(A5)
  4129.   00000A: 2218 '“.' MOVE.L (A0)+,D1
  4130.   etc.
  4131.  
  4132.  
  4133.                              See also 
  4134.  
  4135.   DumpObj command.
  4136.  
  4137.   “The Jump Table” in the chapter “Segment Loader” of Inside Macintosh,
  4138.   for a description of the jump table.
  4139.  
  4140.   Appendix H, “Object File Format.”
  4141.  
  4142. æKY DumpFile
  4143. æC               DumpFile -- display contents of any file
  4144.  
  4145. DumpFile  [ option… ]  filename > dump ≥ progress
  4146.  -rf                # display the resource fork of the file. (Default is 
  4147.                     # data fork.)
  4148.  -bf                # display both forks of the file
  4149.  -a                 # suppress display of ASCII character values. 
  4150.  -h                 # suppress display of hexadecimal characters.
  4151.  -o                 # suppress display of file offsets.
  4152.  -w nn              # width - display nn bytes on each line of output.
  4153.  -g nn              # group nn bytes together without intervening spaces.
  4154.  -p                 # write progress information to diagnostic output.
  4155.  -r byte1[,byteN]   # display only the byte range from byte1 to byteN.
  4156.  
  4157. Status codes returned:
  4158.   0    No problem.
  4159.   1    Syntax error.
  4160.   2    Fatal error.
  4161.  
  4162.                            Description
  4163.  
  4164.   DumpFile lets you display the contents of the resource fork or data
  4165.   fork of a file in a variety of formats.
  4166.  
  4167.  
  4168.                              Examples
  4169.  
  4170.   DumpFile -p ATestFile
  4171.  
  4172.   Formats the data fork of the file ATestFile and writes its contents
  4173.   to standard output. This output has the following format:
  4174.  
  4175.   DumpFile -p ATestFile
  4176.  
  4177.   MPW File Display Utility Version 3.0B1 Release April 15,
  4178.   1988 Start: 1:24:09 PM 4/19/88
  4179.  
  4180.   Copyright Apple Computer, Inc. 1985-1988
  4181.   All Rights Reserved.
  4182.  
  4183.   File : ATestFile
  4184.   Data Fork Length : 20
  4185.   Resource Fork Length : 382
  4186.   Dumping Data Fork from offset 0 to 20
  4187.  
  4188.     0: 54 68 69 73 20 69 73 20 61 20 74 65 73 74 20 66 This.is.a.test.file.
  4189.    10: 69 6C 65 2E
  4190.   DumpFile completed normally
  4191.   Execution required 0 seconds.
  4192.  
  4193.   DumpFile -w 12 -g 4 ATestFile
  4194.  
  4195.   Formats the data fork of the file ATestFile and writes its contents
  4196.   to standard output, grouping four bytes at a time and displaying
  4197.   12 bytes per line. This output has the following format:
  4198.  
  4199.   File : ATestFile
  4200.   Data Fork Length : 20
  4201.   Resource Fork Length : 382
  4202.   Dumping Data Fork from offset 0 to 20
  4203.  
  4204.     0: 54686973 20697320 61207465 This.is.a.te
  4205.     C: 73742066 696C652E st.file.
  4206.  
  4207.   DumpFile -rf -r 0,30 -g 4 ATestFile
  4208.  
  4209.   Formats the resource fork of the file ATestFile and writes the contents
  4210.   of bytes 0 through 30 to standard output in 4-byte groups. This output
  4211.   has the following format:
  4212.  
  4213.   File : ATestFile
  4214.   Data Fork Length : 20
  4215.   Resource Fork Length : 382
  4216.   Dumping Resource Fork from offset 0 to 30
  4217.  
  4218.     0: 00000100 0000014C 0000004C 00000032 .......L...L...2
  4219.    10: 696C652E 6F727920 2227227B 646972 ile.ory.“'”{dir
  4220.  
  4221. æKY DumpObj
  4222. æC                DumpObj -- write formatted object file
  4223.  
  4224. DumpObj [option…] objectFile  > dump ≥ progress
  4225.     -d                      # don't dump object code
  4226.     -h                      # don't write headers (offsets, hex, etc.)
  4227.     -i                      # use ids, rather than names, in dump
  4228.     -jn                     # just use names, rather than ids, in dump
  4229.     -l                      # dump file locations of object records
  4230.     -m name                 # dump only module "name" or module containing
  4231.                             # entry-point "name" (-m option may be used repeatedly)
  4232.     -n                      # dump only the dictionary of names
  4233.     -p                      # write progress information to diagnostics
  4234.     -r byte1[,byte2]        # dump code from byte1 in file (through byte2)
  4235.     -mh                     # omit module summary header
  4236.     -mods                   # dump a module summary with entry point information
  4237.     -sym [Off]              # disable symbolic output 
  4238.          [On | Full]        # enable symbolic output (default), can be followed by:
  4239.             [,NoLabels]     #   omit label information
  4240.             [,NoLines]      #   omit source line information
  4241.             [,NoTypes]      #   omit type information
  4242.             [,NoVars]       #   omit variable information
  4243.  
  4244. Status codes returned:
  4245.   0    No problem.
  4246.   1    Syntax error.
  4247.   2    Fatal error.
  4248.  
  4249.                            Description
  4250.  
  4251.   Disassembles object code that is stored in the data fork of an object
  4252.   file. By convention, object files end in the suffix “.o”. In addition,
  4253.   the object file must have type 'OBJ'.
  4254.  
  4255.  
  4256.                              Examples
  4257.  
  4258.   DumpObj Sample.p.o >SampleDump
  4259.  
  4260.   Formats the file Sample.p.o and writes its contents to the file SampleDump.
  4261.   This output has the following format:
  4262.  
  4263.   Dump of file sample.p.o
  4264.   First: Kind 0 Version 1
  4265.   Dictionary: FirstId 2
  4266.     2: Main
  4267.  
  4268.   Pad
  4269.   Module: Flags $00 ModuleId 1 SegmentId Main
  4270.   Content: Flags $00
  4271.   Contents offset 0000 size 006A
  4272.  
  4273.   000000: 4E56 FFFE 'NV..' LINK A6,#$FFFE
  4274.   000004: 2F07 '/.' MOVE.L D7,-(A7)
  4275.   000006: 42A7 'B.' CLR.L -(A7)
  4276.   000008: 3F3C 0080 '?<..' MOVE.W #$0080,-(A7)
  4277.   etc.
  4278.  
  4279.   For more information, see Appendix H.
  4280.  
  4281.  
  4282.                              See also 
  4283.  
  4284.   DumpCode command.
  4285.  
  4286.   Appendix H, “Object File Format.”
  4287.  
  4288. æKY DumpObjIIGS
  4289. æC                   DumpObjIIGS -- dumps OMF files
  4290. DumpObjIIGS [option…] filename >listing ≥ progress
  4291.  -a                  # print operands only
  4292.  -d                  # dump the file in disassembly format
  4293.  -h                  # dump the segment headers in hex
  4294.  -i                  # Assume short indexes at start of dump
  4295.  -l                  # dump only first and last lines of LCONST records
  4296.  -m                  # assume short accumulator at start of dump
  4297.  -n <segment>        # dump this segment name. May be multiply specified
  4298.  -o                  # dump segment headers only
  4299.  -p                  # print progress to stderr
  4300.  -s                  # print short form of headers
  4301.  -t                  # print expressions in infix form
  4302.  -x                  # dump segments in hexadecimal
  4303.  -xa                 # dump the entire file in hexadecimal
  4304.  
  4305. æKY Duplicate
  4306. æC             Duplicate -- duplicate files and directories
  4307.  
  4308. Duplicate [-y | -n | -c] [-p] [-d | -r] name… target  ≥ progress
  4309.  -y                      # overwrite target files (avoids dialog)
  4310.  -n                      # don't overwrite target files (avoids dialog)
  4311.  -c                      # cancel if conflict occurs (avoids dialog)
  4312.  -p                      # write progress information to diagnostics
  4313.  -d                      # duplicate data fork only
  4314.  -r                      # duplicate resource fork only
  4315.  
  4316. Status codes returned:
  4317.   0    All objects were duplicated.
  4318.   1    Syntax error.
  4319.   2    An error occurred.
  4320.   4    Cancel was selected or implied from the -c option.
  4321.  
  4322.                            Description
  4323.  
  4324.   Duplicates name to targetName. (Name and targetName are file or directory
  4325.   names.) If targetName is a file or doesn’t exist, the file or directory
  4326.   name is duplicated and named targetName. If targetName is a directory,
  4327.   the objects named are duplicated into that directory. (If more than
  4328.   one name is present, targetName must be a directory.) Created objects
  4329.   are given the same creation and modification dates as their source.
  4330.  
  4331.   If a directory is duplicated, its contents (including all subdirectories)
  4332.   are also duplicated. No directory duplicated can be a parent of targetName.
  4333.  
  4334.   Name can also be a volume; if targetName is a directory, name is
  4335.   copied into targetName.
  4336.  
  4337.   A dialog box requests a confirmation if the duplication would overwrite
  4338.   an existing file or folder. You can use the -y, -n, or -c option
  4339.   in scripts to avoid this interaction.
  4340.  
  4341.  
  4342.                              Examples
  4343.  
  4344.   Duplicate Aug86 “Monthly Reports”
  4345.  
  4346.   Assuming “Monthly Reports” is an existing directory, duplicates the
  4347.   file Aug86 into that directory.
  4348.  
  4349.   Duplicate File1 Folder1 “Backup Disk:”
  4350.  
  4351.   Duplicates File1 and Folder1 (including its contents) onto Backup
  4352.   Disk.
  4353.  
  4354.   Duplicate -y File1 File2
  4355.  
  4356.   Duplicates File1 to File2, overwriting File2 if it exists.
  4357.  
  4358.   Duplicate Disk1:≈ HD:Files:
  4359.  
  4360.   Duplicates all of the files on Disk1 into the directory HD:Files.
  4361.  
  4362.   Duplicate Disk1: HD:Files:
  4363.  
  4364.   Duplicates all of Disk1 (as a directory) into HD:Files.
  4365.  
  4366.   Limitation Duplicate doesn’t recognize folders on non-HFS disks.
  4367.  
  4368.  
  4369.                              See also 
  4370.  
  4371.   Move and Rename commands.
  4372.  
  4373.   “File and Window Names” in Chapter 4.
  4374.  
  4375.   “Filename Generation” in Chapter 5.
  4376.  
  4377. æKY DuplicateIIGS
  4378. æC        DuplicateIIGS -- moves files between Mac and GS/OS volumes
  4379. DuplicateIIGS [option…] -m[ac] name… target >listing ≥ progress
  4380. DuplicateIIGS [option…] -pdos  name… target >listing ≥ progress
  4381. DuplicateIIGS [-p] -l
  4382. DuplicateIIGS [-p] -lr
  4383.  -l         # list the root directory of the disk
  4384.  -lr        # list the root directory of the disk and all subdirectories 
  4385.  -m[ac]     # copy Macintosh files to ProDOS file system
  4386.  -n         # don't overwrite target files (avoids dialog)
  4387.  -p         # write progress information to diagnostics
  4388.  -pdos      # copy the ProDOS files to Macintosh file system
  4389.  -y         # overwrite target files (avoids dialog)
  4390.  -d         # copy only the data fork
  4391.  -r         # copy only the resource fork
  4392. æKY Echo
  4393. æC                      Echo -- echo parameters
  4394.  
  4395. Echo [-n] [parameter…]   > parameters
  4396.  -n                      # don't write return following the parameters
  4397.  
  4398. Status codes returned:
  4399.   0    is always returned.
  4400.  
  4401.                            Description
  4402.  
  4403.   Writes its parameters, separated by spaces and terminated by a return,
  4404.   to standard output. If no parameters are specified, only a return
  4405.   is written.
  4406.  
  4407.   Echo is especially useful for checking the results of variable substitution,
  4408.   command substitution, and filename generation.
  4409.  
  4410.  
  4411.                              Examples
  4412.  
  4413.   Echo “Use Echo to write progress info from scripts.”
  4414.  
  4415.   Use Echo to write progress info from scripts.
  4416.  
  4417.   The Echo command above writes the second line to standard output.
  4418.  
  4419.   Echo {Status}
  4420.  
  4421.   Writes the current value of the {Status} variable—that is, the status
  4422.   of the last command executed.
  4423.  
  4424.   Echo ≈.a
  4425.  
  4426.   Echoes the names of all files in the current directory that end with
  4427.   “.a”. (This might be useful as a precaution before executing another
  4428.   command with the argument “≈.a”.)
  4429.  
  4430.   Echo -n > EmptyFile
  4431.  
  4432.   If EmptyFile exists, this command deletes its contents; if the file
  4433.   doesn’t exist, it is created.
  4434.  
  4435.  
  4436.                              See also 
  4437.  
  4438.   Parameters and Quote commands.
  4439.  
  4440. æKY Eject
  4441. æC                       Eject -- eject volumes
  4442.  
  4443. Eject [-m] volume…
  4444.  -m                      # leave the volume mounted
  4445.  
  4446. Status codes returned:
  4447.   0    The disk was successfully ejected.
  4448.   1    Syntax error.
  4449.   2    An error occurred.
  4450.  
  4451.                            Description
  4452.  
  4453.   Flushes the volume, unmounts it, and then ejects it, if it is a 3.5-inch
  4454.   disk. A volume name must end with a colon ( : ). If volume is a number
  4455.   without a colon, it’s interpreted as a drive number.
  4456.  
  4457.     • Note: If you unmount the current volume (the volume containing
  4458.     the current directory), the boot volume becomes the current volume.
  4459.     You can keep the volume mounted with the -m option. (See the
  4460.     chapter “File Manager” of Inside Macintosh.)
  4461.  
  4462.  
  4463.                              Examples
  4464.  
  4465.   Eject Memos:
  4466.  
  4467.   Ejects (and unmounts) the disk titled Memos.
  4468.  
  4469.   Eject 1
  4470.  
  4471.   Ejects and unmounts the disk in drive 1 (the internal drive).
  4472.  
  4473.  
  4474.                              See also 
  4475.  
  4476.   Mount, Unmount, and Volumes commands.
  4477.  
  4478. æKY Entab
  4479. æC                Entab -- convert runs of spaces to tabs
  4480.  
  4481. Entab [option…] [file…]  < file > tabbed ≥ progress
  4482.  -a minValue             # Min run of blanks that can be replaced with a tab
  4483.  -d tabValue             # input tab setting
  4484.  -l quote…               # left quotes that prevent EnTab (default '")
  4485.  -n                      # no quote characters, EnTab everything
  4486.  -p                      # write progress information to diagnostics
  4487.  -q quote…               # quotes that prevent EnTab (default '")
  4488.  -r quote…               # right quotes that prevent EnTab (default '")
  4489.  -t tabValue             # output tab setting
  4490.  
  4491. Status codes returned:
  4492.   0    Normal termination.
  4493.   1    Parameter or option error.
  4494.  
  4495.                            Description
  4496.  
  4497.   Copies the specified text files to standard output, replacing runs
  4498.   of spaces with tabs. The default behavior of Entab is to do the following:
  4499.  
  4500.   1. Detab the input file, using the file’s tab setting (a resource
  4501.   saved with the file by the Shell editor), or 4 if there is none.
  4502.   You can override this “detab” value with the -d option.
  4503.  
  4504.   2. Entab the file, setting tab stops every 4 spaces. You can specify
  4505.   another tab setting with the -t option. The entabbed output file
  4506.   looks the same as the original file(s), but contains fewer characters.
  4507.  
  4508.   Options are also provided for controlling the processing of blanks
  4509.   between quoted strings.
  4510.  
  4511.  
  4512.                              Examples
  4513.  
  4514.   Entab -t 2 Example.p > CleanExample.p
  4515.  
  4516.   Detabs the file Example.p (using the file’s default tab setting),
  4517.   re-entabs it with a tab setting of 2, and writes the resulting output
  4518.   to CleanExample.p.
  4519.  
  4520.   Warning Beware of command formats such as
  4521.  
  4522.   Entab Foo > Foo
  4523.  
  4524.   Limitations Entab does not take into account embedded formatting
  4525.   characters other than tab characters. Thus backspace characters may
  4526.   cause incorrect results.
  4527.  
  4528.   The maximum width for an input line is 255 characters.
  4529.  
  4530.  
  4531.                              See also 
  4532.  
  4533.   Format command.
  4534.  
  4535. æKY Equal
  4536. æC                Equal -- compare files and directories
  4537.  
  4538. Equal [-d | -r] [-i] [-p] [-q] name… target  > differences ≥ progress
  4539.    -d                      # compare data forks only
  4540.    -r                      # compare resource forks only
  4541.    -i                      # ignore files in target not in directory name
  4542.    -p                      # write progress information to diagnostics
  4543.    -q                      # quiet - don't write output, just set {Status}
  4544.  
  4545. Status codes returned:
  4546.   0    Identical files.
  4547.   1    Syntax error.
  4548.   2    Inaccessible or missing parameter.
  4549.   3    Files not equal.
  4550.  
  4551.                            Description
  4552.  
  4553.   Compares name to targetName. By default, Equal makes no comment if
  4554.   files are the same; if they differ, it announces the byte at which
  4555.   the difference occurred. When comparing directories, the default
  4556.   condition is to report all differences, including files not found—the
  4557.   -i option ignores files in targetName that are not present in name.
  4558.  
  4559.   If targetName is a file, every name must also be a file. The specified
  4560.   files are compared with targetName.
  4561.  
  4562.   If targetName is a directory and name is a file, Equal checks in
  4563.   targetName for the file name and compares the two files. That is,
  4564.   the command
  4565.  
  4566.   Equal File1 Dir1
  4567.  
  4568.   compares File1 with :Dir1:File1.
  4569.  
  4570.   If more than one name is specified, Equal compares each name with
  4571.   the corresponding file or directory in targetName. All subdirectories
  4572.   are also compared. For example,
  4573.  
  4574.   Equal File1 Dir1 Dir2
  4575.  
  4576.   If targetName is a directory, name is a directory, and only one name
  4577.   is specified, the Equal command directly compares the two directories.
  4578.   That is, the command
  4579.  
  4580.   Equal Dir1 Dir2
  4581.  
  4582.   compares Dir1 (and all subdirectories) with Dir2.
  4583.  
  4584.  
  4585.                              Examples
  4586.  
  4587.   Equal File1 File1Backup
  4588.  
  4589.   Reports if the files are different and at what point they differ,
  4590.   in a message
  4591.  
  4592.   such as
  4593.  
  4594.   File1 File1Backup differ in data fork, at byte 5
  4595.  
  4596.   Equal -i HD:Dir1 Disk1:Dir1
  4597.  
  4598.   Compares all files and directories in HD:Dir1 with files and directories
  4599.   with the same names found in Disk1:Dir1, and reports any differences.
  4600.   This command does not report files in Disk1:Dir1 that aren’t found
  4601.   in HD:Dir1.
  4602.  
  4603.   Equal -i -d Backup: HD:Source
  4604.  
  4605.   Compares the data forks of all files on the volume Backup: with all
  4606.   those of the same name in the directory HD:Source.
  4607.  
  4608.   Equal -p Old:≈.c HD:Source
  4609.  
  4610.   Compares all files on Old: ending in “.c” with their counterparts
  4611.   in HD:Source. Prints progress information as the comparison proceeds.
  4612.  
  4613.  
  4614.                              See also 
  4615.  
  4616.   Compare command.
  4617.  
  4618. æKY Erase
  4619. æC                     Erase -- initialize volumes
  4620.  
  4621. Erase [-y] [-s] volume…
  4622.  -y                      # yes - erase the disk (avoids dialog)
  4623.  -s                      # single-sided - 400K (default 800K)
  4624.  
  4625. Status codes returned:
  4626.   0    Successful initialization.
  4627.   1    Syntax error.
  4628.   2    No such volume, or boot volume.
  4629.   3    Errors during the initialization procedure.
  4630.  
  4631.                            Description
  4632.  
  4633.   Initializes the specified volumes— the previous contents are destroyed.
  4634.   A volume name must end with a colon ( : ). If volume is a number
  4635.   without a colon, it’s interpreted as a disk drive number.
  4636.  
  4637.   A dialog box requests confirmation before proceeding with the command,
  4638.   unless the -y option is specified. The -y option can be used in scripts
  4639.   to avoid this interaction.
  4640.  
  4641.  
  4642.                              Examples
  4643.  
  4644.   Erase Reports:
  4645.  
  4646.   Initializes the volume entitled Reports.
  4647.  
  4648.   Erase 1
  4649.  
  4650.   Initializes the volume in drive 1 (the internal drive). The disk
  4651.   will be formatted as a 400K disk if drive 1 is a 400K drive, or as
  4652.   an 800K disk if drive 1 is an 800K drive.
  4653.  
  4654. æKY Evaluate
  4655. æC                  Evaluate -- evaluate an expression
  4656.  
  4657. Evaluate [-h | -o | -b] [word…]  > value
  4658. Evaluate Name [binary operator]= expression
  4659.   -h                      # display result in hexadecimal (leading 0x)
  4660.   -o                      # display result in octal (leading 0)
  4661.   -b                      # display result in binary (leading 0b)
  4662.  
  4663. Status codes returned:
  4664.   0    Valid expression.
  4665.   1    Invalid expression.
  4666.  
  4667.                            Description
  4668.  
  4669.   The list of words is taken as an expression. After evaluation, the
  4670.   result is written to standard output. Missing or null parameters
  4671.   are taken as zero. You should quote string operands that contain
  4672.   blanks or any of the characters listed in the table that follows.
  4673.  
  4674.   The operators and precedence are mostly those of the C language;
  4675.   descriptions follow.
  4676.  
  4677.   The second form of the Evaluate command evaluates the list of words
  4678.   and assigns the result to the variable name. The result of the expression
  4679.   is not written to standard output in this case. C style operations
  4680.   of the form “+=”, “-=”, and so on, are supported. If name is undefined
  4681.   at the time of execution, it is interpreted as zero.
  4682.  
  4683.   Different radices can be used in the input expression, and the result
  4684.   can be output in a different radix by using the -h, -o, or -b option.
  4685.   The default radix is decimal.
  4686.  
  4687.   Expressions: An expression can include any of the following operators.
  4688.   (In some cases, two or three different symbols can be used for the
  4689.   same operation.) The operators are listed in order of precedence;
  4690.   within each group, operators have the same precedence.
  4691.  
  4692.   Operator           Operation
  4693.  
  4694.   1. (expr)          Parentheses are used to group expressions
  4695.  
  4696.   2.  -              Unary negation
  4697.  
  4698.       ~              Bitwise negation
  4699.  
  4700.       !              NOT ¬ Logical NOT
  4701.  
  4702.   3.  *              Multiplication
  4703.  
  4704.       ÷              DIV Division
  4705.  
  4706.      %               MOD Modulus division
  4707.  
  4708.   4. +               Addition
  4709.  
  4710.      -               Subtraction
  4711.  
  4712.   5. <<              Shift left
  4713.  
  4714.      >>              Shift right
  4715.  
  4716.   6. <               Less than
  4717.  
  4718.      <= ≤            Less than or equal to
  4719.  
  4720.      >               Greater than
  4721.  
  4722.      >= ≥            Greater than or equal to
  4723.  
  4724.   7. ==              Equal
  4725.  
  4726.      != <> ≠         Not equal
  4727.  
  4728.      =~              Equal—regular expression
  4729.  
  4730.      !~              Not equal—regular expression
  4731.  
  4732.   8. &               Bitwise AND
  4733.  
  4734.   9. ^               Bitwise XOR
  4735.  
  4736.   10. |              Bitwise OR
  4737.  
  4738.   11. && AND         Logical AND
  4739.  
  4740.   12. || OR          Logical OR
  4741.  
  4742.   All operators group from left to right. Parentheses can be used to
  4743.   override the operator precedence. Null or missing operands are interpreted
  4744.   as zero. The result of an expression is always a string representing
  4745.   a number in the specified radix (the default is decimal).
  4746.  
  4747.   The logical operators !, NOT, ¬, &&, AND, | |, and OR interpret null
  4748.   and zero operands as false, and nonzero operands as true. Relational
  4749.   operators return the value 1 when the relation is true, and the value
  4750.   0 when the relation is false.
  4751.  
  4752.   The string operators ==, !=, =~, and !~ compare their operands as
  4753.   strings. All others operate on numbers. Numbers may be decimal, hexadecimal,
  4754.   octal, or binary integers representable by a 32-bit signed value.
  4755.   Hexadecimal numbers begin with either $ or 0x. Octal numbers begin
  4756.   with a 0 (zero). Binary numbers begin with 0b. Every expression is
  4757.   computed as a 32-bit signed value. Overflows are ignored.
  4758.  
  4759.   Input Radices
  4760.  
  4761.   Decimal number [0–9]
  4762.  
  4763.   Hexadecimal number 0x[0–9A–F]
  4764.  
  4765.   Octal number 0[0–7]
  4766.  
  4767.   Binary number 0b[01]
  4768.  
  4769.   The pattern-matching operators =~ and !~ are like == and != except
  4770.   that the right side is a regular expression that is matched against
  4771.   the left operand. Regular expressions must be enclosed within the
  4772.   regular expression delimiters /…/. Regular expressions are summarized
  4773.   in Appendix B.
  4774.  
  4775.     • Note: There is one difference between using regular expressions
  4776.     after =~ and !~ and using them in editing commands. When evaluating
  4777.     an expression that contains the tagging operator, ®, the Shell
  4778.     creates variables of the form {®n}, containing the matched substrings
  4779.     for each ® operator. (See the examples that follow.)
  4780.  
  4781.   Filename generation, conditional execution, pipe specifications,
  4782.   and input/output specifications are disabled within expressions,
  4783.   to allow the use of many special characters that would otherwise
  4784.   have to be quoted.
  4785.  
  4786.   Expressions are also used in the If, Else, Break, Continue, and Exit
  4787.   commands.
  4788.  
  4789.  
  4790.                              Examples
  4791.  
  4792.   Evaluate (1+2) * (3+4)
  4793.  
  4794.   Does the computation and writes the result to standard output.
  4795.  
  4796.   Evaluate -h 8 + 8
  4797.  
  4798.   Does the computation and writes the result to standard output in
  4799.   hexadecimal (0x10).
  4800.  
  4801.   Evaluate 0xA + 6
  4802.  
  4803.   Writes the result 16 to standard output. (The default output radix
  4804.   is decimal. Use -h for hexadecimal.)
  4805.  
  4806.   Evaluate lines += 1
  4807.  
  4808.   The Evaluate command increments the value of the Shell variable {lines}
  4809.   by 1. If {lines} was undefined before executing the command, {lines}
  4810.   would be 1 after execution.
  4811.  
  4812.   ( Evaluate “{aPathname}” =~ /(([¬:]+:)*)®1≈/ ) > Dev:Null
  4813.  
  4814.   Echo {®1}
  4815.  
  4816.   These commands examine a pathname contained in the variable {aPathname}
  4817.   and return the directory prefix portion of the name. In this case,
  4818.   Evaluate is used for its side effect of enabling regular expression
  4819.   processing of a filename pattern. The right side of the expression
  4820.   ( /(([¬:]+:)*)®1≈/ ) is a regular expression that matches everything
  4821.   in a pathname up to the last colon and remembers it as the Shell
  4822.   variable {®1}. Evaluate’s actual output is not of interest, so it’s
  4823.   redirected to the bit bucket, Dev:Null. (See “Pseudo-Filenames” in
  4824.   Chapter 5.) Note that the use of I/O redirection means that the Evaluate
  4825.   command must be enclosed in parentheses so that the output redirection
  4826.   symbol, >, is not taken as an expression operator.
  4827.  
  4828.   This is a complex but useful example of implementing a “substring”
  4829.   function. For a similar example, see the Rename command.
  4830.  
  4831.  
  4832.                              See also 
  4833.  
  4834.   “Structured Commands” in Chapter 5.
  4835.  
  4836.   “Pattern Matching (Using Regular Expressions)” in Chapter 6, and
  4837.   Appendix B.
  4838.  
  4839. æKY Execute
  4840. æC         Execute -- execute command file in the current scope
  4841.  
  4842. Execute commandFile
  4843.  
  4844. Execute returns the status returned by script.
  4845.  
  4846.                            Description
  4847.  
  4848.   Executes the script as if its contents appeared in place of the Execute
  4849.   command. This means that variable definitions, exports, and aliases
  4850.   in the script will continue to exist after it has finished executing.
  4851.   (Normally these definitions, exports, and aliases would be local
  4852.   to the script.) Any parameters following script are ignored. Any
  4853.   parameters to the enclosing script are available within script.
  4854.  
  4855.     • Note: If script is not a command file (that is, if it’s a built-in
  4856.     command, tool, or application), the command is run as if the
  4857.     word Execute did not appear. Parameters are passed to the command
  4858.     as usual.
  4859.  
  4860.  
  4861.                              Examples
  4862.  
  4863.   Execute {ShellDirectory}Startup
  4864.  
  4865.   Executes the Startup (and UserStartup) scripts. This command is useful
  4866.   for testing any changes you’ve made to the Startup-UserStartup script.
  4867.   Variable definitions, exports, and aliases set in Startup and UserStartup
  4868.   will be available after Startup is done executing.
  4869.  
  4870.  
  4871.                              See also 
  4872.  
  4873.   “Defining and Redefining Variables” in Chapter 5.
  4874.  
  4875.   “The Startup and UserStartup Files” in Chapter 5.
  4876.  
  4877. æKY Exists
  4878. æC        Exists -- confirm the existence of a file or directory
  4879.  
  4880. Exists [-d | -f | -w] [-q] name…  > file
  4881.   -d                      # check if name is a directory
  4882.   -f                      # check if name is a file
  4883.   -w                      # check if name is a file and writeable
  4884.   -q                      # don't quote file names with special characters
  4885.  
  4886. Status codes returned:
  4887.   0    No error.
  4888.   1    Syntax error.
  4889.   2    Other error.
  4890.  
  4891.                            Description
  4892.  
  4893.   Determines the existence of the file or directory name. The options
  4894.   help you to distinguish between directories and files and different
  4895.   access permissions. The nonexistence of name is not considered an
  4896.   error (status remains zero).
  4897.  
  4898.  
  4899.                              Examples
  4900.  
  4901.   If Not “`Exists -d HD:dir`”
  4902.     NewFolder HD:dir
  4903.   End
  4904.   Duplicate ≈.c HD:dir
  4905.  
  4906.   This example creates a new directory and copies all files ending
  4907.   with “.c” in the current directory to this new directory.
  4908.  
  4909.  
  4910.                              See also 
  4911.  
  4912.   Newer command.
  4913.  
  4914. æKY Exit
  4915. æC                   Exit -- exit from a command file
  4916.  
  4917. Exit [status] [If expression]
  4918.  
  4919. If status is present, it is returned as the status value of the 
  4920. script. If the expression is invalid, –5 is returned. Otherwise, the status 
  4921. of the last command executed is returned. 
  4922.  
  4923.                            Description
  4924.  
  4925.   If the expression is nonzero (that is, true), Exit terminates execution
  4926.   of the script in which it appears. When used interactively, Exit
  4927.   terminates execution of previously entered commands. Status is a
  4928.   number; if present, it is returned as the status value of the script.
  4929.   Otherwise, the status of the previous command is returned. If the
  4930.   “If expression” is omitted, the Exit is unconditional. (For a definition
  4931.   of expression, refer to the description of the Evaluate command.)
  4932.  
  4933.  
  4934.                              Examples
  4935.  
  4936.   Exit {ExitStatus}
  4937.  
  4938.   As the last line of a script, this Exit command would return as a
  4939.   status value whatever value had previously been assigned to {ExitStatus}.
  4940.  
  4941.  
  4942.                              See also 
  4943.  
  4944.   Evaluate command (for information on expressions).
  4945.  
  4946.   “Structured Commands” in Chapter 5.
  4947.  
  4948.   {Exit} and {Status} variables, in “Variables,” Chapter 5.
  4949.  
  4950. æKY Export
  4951. æC            Export -- make variables available to commands
  4952.  
  4953. Export [-r | -s | name…]  > exports
  4954.  -r                      # generate Unexport commands for all exported variables
  4955.  -s                      # print the names only
  4956.  
  4957. Status codes returned:
  4958.   0    No errors.
  4959.   1    Syntax error.
  4960.  
  4961.                            Description
  4962.  
  4963.   Make the specified variables available to scripts and tools. The
  4964.   list of variables exported within a script is local to that script.
  4965.   An enclosed script or tool inherits a list of exported variables
  4966.   from the enclosing script . (See Figure 5-1 in Chapter 5 of the MPW manual
  4967.   for clarification.)
  4968.  
  4969.     • Note: You can make a variable available to all scripts and
  4970.     tools by setting and exporting it in the Startup or UserStartup
  4971.     files. (Startup acts as the enclosing script for all Shell operations.)
  4972.  
  4973.   If no names are specified, a list of exported variables is written
  4974.   to standard output. (Note that the default output of Export is in
  4975.   the form of Export commands.)
  4976.  
  4977.  
  4978.                              Examples
  4979.  
  4980.   Set AIncludes {MPW}Interfaces:AIncludes:
  4981.  
  4982.   Export AIncludes
  4983.  
  4984.   Defines the variable {AIncludes} as the pathname {MPW}Interfaces:AIncludes:
  4985.   and makes it available to scripts and programs.
  4986.  
  4987.  
  4988.                              See also 
  4989.  
  4990.   Unexport, Set, and Execute commands.
  4991.  
  4992.   “The Startup and UserStartup Files” in Chapter 5.
  4993.  
  4994.   “Exporting Variables” in Chapter 5.
  4995.  
  4996. æKY ExpressIIGS
  4997. æC       ExpressIIGS -- converts files from OMF to ExpressLoad format
  4998. ExpressIIGS [-p] loadfile [-o outputfile] ≥ progress
  4999.  loadfile        # full name of the load file you wish to convert
  5000.  -o outputfile   # specify the destination filename
  5001.  -p              # write progress to diagnostic output
  5002.  
  5003. æKY FileDiv
  5004. æC          FileDiv -- divide a file into several smaller files
  5005.  
  5006. FileDiv [option…] file [prefix]  ≥ progress
  5007.  -b              # input is a byte stream instead of lines
  5008.  -f              # split file at formfeed character
  5009.  -n splitPoint   # split file after splitPoint lines or bytes (-b)
  5010.  -p              # write progress information to diagnostics
  5011.  -s n            # set -b input buffer to n * 512 bytes
  5012.  
  5013. Status codes returned:
  5014.   0    Normal termination.
  5015.   1    Parameter or option error.
  5016.  
  5017.                            Description
  5018.  
  5019.   FileDiv is the inverse of the Catenate command. It is used to break
  5020.   a large file into several smaller pieces. The input file is divided
  5021.   into smaller files, each containing an equal number of lines determined
  5022.   by the splitpoint (default=2000). The last file contains whatever
  5023.   is left over.
  5024.  
  5025.   There is also an option (-f) for splitting a file only when a form
  5026.   feed character
  5027.  
  5028.   (ASCII $0C) occurs as the first character of a line that is beyond
  5029.   the splitpoint. This option lets you split a file at points that
  5030.   are known to be the tops of pages.
  5031.  
  5032.   Each group of splitpoint lines is written to a file with the name
  5033.   prefixNN, where NN is a number starting at 01. If the prefix is omitted,
  5034.   the input file name is used as the prefix.
  5035.  
  5036.  
  5037.                              Examples
  5038.  
  5039.   FileDiv -f -n 2500 Bigfile
  5040.  
  5041.   Splits Bigfile into files of at least 2500 lines; splits the file
  5042.   at points where there are form feed characters. The output files
  5043.   have the names BigfileNN, where NN is 01, 02, and so on.
  5044.  
  5045.   Limitation The maximum length of an input line is 255 characters.
  5046.  
  5047. æKY Files
  5048. æC                  Files -- list files and directories
  5049.  
  5050. Files [option…] [name…]  > fileList
  5051.  -c creator              # list only files with this creator
  5052.  -d                      # list only directories
  5053.  -f                      # list full pathnames
  5054.  -i                      # treat all arguments as files
  5055.  -l                      # long format (type, creator, size, dates, etc.)
  5056.  -m columns              # n column format, where n = columns
  5057.  -n                      # don't print header in long or extended format
  5058.  -o                      # omit directory headers
  5059.  -q                      # don't quote filenames with special characters
  5060.  -r                      # recursively list subdirectories
  5061.  -s                      # suppress the listing of directories
  5062.  -t type                 # list only files of this type
  5063.  -x format               # extended format with the fields specified by format
  5064.  
  5065.  Note: The following characters can specify the format
  5066.      a   Flag attributes
  5067.      b   Logical size, in bytes, of the data fork
  5068.      r   Logical size, in bytes, of the resource fork
  5069.      c   Creator of File ("Fldr" for folders)
  5070.      d   Creation date
  5071.      k   Physical size in kilobytes of both forks
  5072.      m   Modification date
  5073.      t   Type
  5074.      o   Owner (only for folders on a file server)
  5075.      g   Group (only for folders on a file server)
  5076.      p   Privileges (only for folders on a file server)
  5077.  
  5078. Status codes returned:
  5079.   0    All names were processed successfully.
  5080.   1    Syntax error.
  5081.   2    An error occurred.
  5082.  
  5083.                            Description
  5084.  
  5085.   For each disk or directory named, Files lists its contents; for each
  5086.   file named, Files writes its name and any other information requested.
  5087.   Information is written to standard output. When a directory is listed,
  5088.   all subdirectories are listed first in alphabetical order, followed
  5089.   by all files in alphabetical order. If no name is given, the current
  5090.   directory is listed.
  5091.  
  5092.  
  5093.                              Examples
  5094.  
  5095.   files -r -s -f
  5096.  
  5097.   HD:source:defs.h
  5098.   HD:source:main.c
  5099.   HD:source:backup:main.c
  5100.   HD:source:backup:defs.h
  5101.   HD:source:junk:tmpfile
  5102.  
  5103.   Recursively lists the contents of the current directory, giving full
  5104.   pathnames and suppressing the printing of directory names.
  5105.  
  5106.   files -d
  5107.  
  5108.   :backup:
  5109.   :junk:
  5110.  
  5111.   Lists only the directories in the current directory.
  5112.  
  5113.   Files -i -x kd {AIncludes}
  5114.  
  5115.   Name                         Size    Creation-Date
  5116.   --------------------------- ------ ----------------
  5117.   HD:MPW:Interfaces:AIncludes: 365K   8/25/87 5:32 AM
  5118.  
  5119.   Lists the size and creation date of the {AIncludes} directory. Notice
  5120.   how the -i option is used to avoid printing the contents of the directory.
  5121.  
  5122.   files -m 2
  5123.  
  5124.   :backup: deFs.h
  5125.   :junk: main.c
  5126.  
  5127.   This is the two-column format. Notice the order of the files.
  5128.  
  5129. æKY Find
  5130. æC                Find -- find and select a text pattern
  5131.  
  5132. Find [-c count] selection [window]
  5133.  -c count                # find the nth selection, where n = count
  5134.  
  5135. Status codes returned:
  5136.   0    At least one instance of the selection was found.
  5137.   1    Syntax error.
  5138.   2    Any other error.
  5139.  
  5140.                            Description
  5141.  
  5142.   Creates a selection in window. If no window is specified, the target
  5143.   window (the second window from the front) is assumed. It’s an error
  5144.   to specify a window that doesn’t exist.
  5145.  
  5146.   Selection is a selection as defined in Chapter 6 and in Appendix B of the
  5147.   MPW manual.
  5148.  
  5149.     • Note: Searches do not necessarily start at the beginning of
  5150.     a window. A forward search begins at the end of the current selection
  5151.     and continues to the end of the document. A backward search begins
  5152.     at the start of the current selection and continues to the beginning
  5153.     of the document.
  5154.  
  5155.   All searches are not case sensitive by default. You can specify case-sensitive
  5156.   searches by first setting the Shell variable {CaseSensitive} to a
  5157.   nonzero value. (Or, you can automatically set {CaseSensitive} by
  5158.   checking Case Sensitive in the dialog boxes displayed by the Find
  5159.   and Replace menu items.)
  5160.  
  5161.  
  5162.                              Examples
  5163.  
  5164.   Find •
  5165.  
  5166.   Positions the insertion point at the beginning of the target window.
  5167.  
  5168.   Find -c 5 /procedure/ Sample.p
  5169.  
  5170.   Selects the fifth occurrence of “procedure” in the window Sample.p.
  5171.  
  5172.   Find 332
  5173.  
  5174.   Selects line 332 in the target window.
  5175.  
  5176.  
  5177.                              See also 
  5178.  
  5179.   “Selections” and “Pattern Matching” in Chapter 6, and Appendix B.
  5180.  
  5181.   “Find Menu” in Chapter 3.
  5182.  
  5183. æKY Flush
  5184. æC          Flush -- flush the tools that the Shell has cached
  5185.  
  5186. Flush
  5187. \.
  5188. Status codes returned:
  5189.   0    No errors always returned.
  5190.  
  5191.                            Description
  5192.  
  5193.   Flush clears the MPW Shell's tool cache.
  5194.  
  5195.   The MPW Shell keeps the most recently used tools in memory so that
  5196.   execution can be faster. However, there are times when you don’t
  5197.   want the tools to be in the cache. For example, you cannot run a
  5198.   tool, and then switch to the Finder and delete the file. The Finder
  5199.   will report that the tool is busy. You might also want to flush the
  5200.   cache is when you are running benchmarks or timing tool performance.
  5201.  
  5202.  
  5203.                              Examples
  5204.  
  5205.   Flush
  5206.  
  5207.   Flush the current cache. This will free all tools in the cache.
  5208.  
  5209. æKY For
  5210. æC                  For -- repeat commands once per parameter
  5211.  
  5212. For name In word…
  5213.  command…
  5214. End
  5215.  
  5216. Status codes returned:
  5217.   0    The list of words or list of commands was empty.
  5218.   –3   There was an error in the parameters to For.
  5219.  
  5220.                            Description
  5221.  
  5222.   Executes the list of commands once for each word from the “In word…”
  5223.   list. The current word is assigned to variable name, and you can
  5224.   therefore reference it in the list of commands by using the notation
  5225.   {name}. You must end each line with either a return character (as
  5226.   shown above) or with a semicolon (;).
  5227.  
  5228.   The Break command can be used to terminate the loop. The Continue
  5229.   command can be used to terminate the current iteration of the loop.
  5230.  
  5231.   The pipe specification (|), conditional command terminators (&& and
  5232.   ||), and input/output specifications (<, >, >>, ≥, ≥≥, ∑, and ∑∑)
  5233.   may appear following the End; they apply to all of the commands in
  5234.   the list.
  5235.  
  5236.  
  5237.                              Examples
  5238.  
  5239.   For i In 1 2 3
  5240.     Echo i = {i}
  5241.   End
  5242.  
  5243.   Returns the following:
  5244.  
  5245.   i = 1
  5246.   i = 2
  5247.   i = 3
  5248.  
  5249.   For File In ≈.c
  5250.     C {File} ; Echo {File} compiled.
  5251.   End
  5252.  
  5253.   This example compiles every file in the current directory whose name
  5254.   ends with the suffix “.c”. The Shell first expands the filename pattern
  5255.   ≈.c, creating a list of the filenames after the “In” word. The enclosed
  5256.   commands are then executed once for each name in the list. Each time
  5257.   the loop is executed, the variable {File} represents the current
  5258.   word in the list. {File} is quoted because a filename could contain
  5259.   spaces or other special characters.
  5260.  
  5261.   For file in Startup UserStartup Suspend Resume Quit
  5262.     Entab {file} > temp
  5263.     Rename -y temp {file}
  5264.     Print -h {file}
  5265.     Echo {file}
  5266.   End
  5267.  
  5268.   This example entabs (replaces multiple spaces with tabs) the five
  5269.   files listed, prints them with headings, and echoes the name of each
  5270.   file after printing is complete. You might want to use this set of
  5271.   commands before making copies of the files to give to a friend. Entabbing
  5272.   the files saves considerable disk space, and printing them gives
  5273.   you some quick documentation to go with the files.
  5274.  
  5275.  
  5276.                              See also 
  5277.  
  5278.   Loop, Break, and Continue commands.
  5279.  
  5280.   “Structured Commands” in Chapter 5.
  5281.  
  5282. æKY Format
  5283. æC        Format -- set or display formatting options for a window
  5284.  
  5285. Format [[-f font] [-s fontsize] [-t tabsize] [-a attr]] | [-x fmt] [window…]
  5286.  -f fontName             # set font to fontName
  5287.  -s fontSize             # set the font size to fontSize
  5288.  -t tabSize              # set the tab size to tabSize
  5289.  -a attr                 # set the auto indent and show invisibles flags
  5290.  -x fmt                  # output the current format in the specified format
  5291.  
  5292.  Note: The following attributes may be used with the -a option:
  5293.      A   auto indentation on
  5294.      a   auto indentation off
  5295.      I   show invisibles on
  5296.      i   show invisibles off
  5297.      L   lock auto scrolling
  5298.      l   unlock auto scrolling
  5299.  
  5300.  Note: The following characters may be used with the -x option:
  5301.      f   font name
  5302.      s   font size
  5303.      t   tab size
  5304.      a   attributes
  5305.  
  5306. Status codes returned:
  5307.   0    No errors.
  5308.   1    Syntax error (error in parameters).
  5309.   2    All other errors.
  5310.  
  5311.                            Description
  5312.  
  5313.   This is a scriptable form of the Format menu command in the Edit
  5314.   menu. Use it to set the format of a specified list of windows. If
  5315.   no window is specified, the command operates on the target window.
  5316.   If no options are specified (other than -x), the current format settings
  5317.   are written to standard output.
  5318.  
  5319.     • Note: The Format command (and the Format menu command) modify
  5320.     the format of an existing window. The format related variables
  5321.     such as {Tab} and {Font} are used to initialize the format of
  5322.     a new window.
  5323.  
  5324.  
  5325.                              Examples
  5326.  
  5327.   Format -f Monaco -t 8 -a A {target}
  5328.  
  5329.   Sets the font, tab size, and auto-indent in the target window. The
  5330.   font size and invisible settings are not changed.
  5331.  
  5332.   Format -s 12 MyWindow
  5333.  
  5334.   Changes the font size in MyWindow to 12 point.
  5335.  
  5336.   Format {Target}
  5337.  
  5338.   A format statement with no options displays the current format of
  5339.   the window, such as the following:
  5340.  
  5341.   Format -f Monaco -s 9 -t 8 -a Ai
  5342.  
  5343.   You can then select and execute this output format.
  5344.  
  5345.   Format -x tsf
  5346.  
  5347.   4 9 Monaco
  5348.  
  5349.   Displays only the values of the specified options. Use this option
  5350.   for easily retrieving one or two values and assigning them to Shell
  5351.   variables for later use.
  5352.  
  5353.  
  5354.                              See also 
  5355.  
  5356.   The “Edit Menu,” in Chapter 3.
  5357.  
  5358.   “Variables” in Chapter 5.
  5359.  
  5360. æKY Get
  5361. æC             Get -- get a record from an indexed file
  5362.  
  5363. Get (dataFile… | -dfl listfFle) [-k key] [-width w] [-d default key] [-h | -h2] 
  5364.     [-l] [-m] [-nf] [-q] [-s] [-search] [-t] [-sfl] [-y] [-field field list 
  5365.     [-format format string] ] [-lessFields field list]
  5366.  
  5367.  
  5368.     dataFile                # A specially formatted help file which must be 
  5369.                             # accompanied by an index file whose name is of 
  5370.                             # the form: dataFile.index, and and whose type is 'btre'
  5371.     -dfl listFile           # listFile contains a list of datafiles
  5372.     -k keyword              # keyword in the datafile's index file
  5373.     -width w                # column format for key lists, w = 1..200 is the 
  5374.                             # window width in characters
  5375.     -d default              # use default keyword if no keyword is specified
  5376.     -h                      # write full header
  5377.     -h2                     # write short header (only the used datafile)
  5378.     -l                      # list all keys in the first data file that begin
  5379.                             # with nnn, where nnn is the keyword following -k
  5380.     -lessFields tag [,tag]… # remove the named items from the existing field list 
  5381.                             # (default list or as specified by -field)
  5382.     -m                      # Select the keyword that was found and assign a marker to the selection
  5383.     -nf                     # no filtering; include field tags
  5384.     -q                      # quiet output when keyword not found
  5385.     -s                      # use the selection in the active window as keyword
  5386.     -search                 # text search datafile for occurrences of keyword
  5387.     -t                      # write out template of the requested function/procedure
  5388.     -field tag[,tag]…       # specify the data field(s) to display
  5389.     -format format_string   # specify string(s) to be output in front of data
  5390.                             # specified in -field option.  '%s' flags in string 
  5391.                             # correspond ordinally to tags in -field option
  5392.     -sfl                    # produce ordered list of data files 
  5393.                             # (requires -dfl listFile)
  5394.     -y                      # do not present dialog before (re)building index file
  5395.  
  5396. Status codes returned:  
  5397.   0    The search was successful
  5398.   1    There was a syntax error
  5399.   2    There was an error in processing
  5400.   3    There was a system or out of memory error
  5401.   4    The key was not found.
  5402.  -9    The user aborted the program
  5403.    
  5404.                            Description
  5405.  
  5406.   Get searches the btree file dataFile.index looking for the key word
  5407.   key. If found, Get will return data associated with the key word from 
  5408.   the file dataFile.  The data may be formatted by columns.
  5409.  
  5410. æKY GetErrorText
  5411. æC     GetErrorText -- display error messages based on message number
  5412.  
  5413. GetErrorText [-f filename] [-s filename] [-n] [-p] errnbr[,insert,…] …
  5414. GetErrorText -i idnbr,…
  5415.  # display error messages based on message number
  5416.  
  5417.  -f filename             # explicit error msg file
  5418.  -i idnbr                # report meaning of System Error Handler ID number
  5419.  -n                      # suppress error numbers in displayed messages
  5420.  -p                      # write SysErrs's version info to diagnostics
  5421.  -s filename             # explicit system error msg file (default SysErrs.Err)
  5422.  
  5423. Status codes returned:
  5424.   0    Normal termination.
  5425.   1    Parameter or option error.
  5426.  
  5427.                            Description
  5428.  
  5429.   Displays the error messages corresponding to a set of specified error
  5430.   numbers or ID numbers. By default, GetErrorText assumes that the
  5431.   error numbers correspond to Macintosh Operating System error numbers.
  5432.   The file SysErrs.Err is a special file used by MPW tools to determine
  5433.   the error messages corresponding to system error numbers. Other system
  5434.   error message files may be specified by using the -s option.
  5435.  
  5436.   In addition to system errors, some tools have their own error message
  5437.   files. For example, the assembler's error message file is in the
  5438.   data resource fork of Asm itself. For such tools, you can display
  5439.   the error messages corresponding to tool error numbers by specifying
  5440.   the -f option. In this case, you can specify sample inserts, along
  5441.   with the error numbers, for error messages that take inserts, as
  5442.   shown above.
  5443.  
  5444.   GetErrorText can also display the meanings of the ID numbers reported
  5445.   by the System Error Handler in alert dialog boxes. The -i option
  5446.   is used for this purpose.
  5447.  
  5448.  
  5449.                              Examples
  5450.  
  5451.   GetErrorText -43 -44 -45
  5452.  
  5453.   Displays the error messages corresponding to system errors -43, -44,
  5454.   and -45.
  5455.  
  5456.   GetErrorText -i 28 2
  5457.  
  5458.   Displays the error messages corresponding to system ID numbers 28
  5459.   and 2.
  5460.  
  5461. æKY GetFileName
  5462. æC          GetFileName -- display a Standard File dialog box
  5463.  
  5464. GetFileName [-q] [-s] 
  5465.             [-c | [[-t TYPE]… | -p | -d | -wd] [-m message] [-b buttontitle] [pathname]]
  5466.     -b buttontitle          # specify the default button's title
  5467.     -c                      # write current standard file path to standard output
  5468.     -d                      # select a directory
  5469.     -wd                     # select a directory on a non-locked volume
  5470.     -m message              # specify a prompt
  5471.     -p                      # select a new filename (SFPutFile) 
  5472.     -q                      # suppress quoting of filenames
  5473.     -s                      # return 0 status even if cancel is clicked
  5474.     -t type                 # specify file type for SFGetFile dialog
  5475.  
  5476. Status codes returned:
  5477.   0    User specified a file and no errors occurred.
  5478.   1    Parameter or option error.
  5479.   2    System error.
  5480.   4    User canceled the standard file dialog box.
  5481.  
  5482.                            Description
  5483.  
  5484.   GetFileName displays a standard file dialog box. Either SFPutFile
  5485.   or SFGetFile is called, and the returned filename or pathname is
  5486.   written to standard output. The standard file starting directory
  5487.   is set to pathname if specified. If pathname includes a local filename
  5488.   and if SFPutFile is called, the local filename is used as the default
  5489.   filename. See the examples.
  5490.  
  5491.  
  5492.                              Examples
  5493.  
  5494.   Open `GetFileName -t TEXT {pinterfaces}`
  5495.  
  5496.   Opens the text file in directory {pinterfaces} chosen in SFGetFile
  5497.   by the user.
  5498.  
  5499.   GetFileName -p HD:MPW:StartUp
  5500.  
  5501.   An SFPutFile dialog box is displayed with the directory set to HD:MPW:
  5502.   and StartUp is displayed in the textedit field of the dialog box.
  5503.  
  5504.   Limitation The resulting filename cannot be longer than 255 characters.
  5505.  
  5506.  
  5507.                              See also 
  5508.  
  5509.   “The Standard File Package,” Inside Macintosh, Volume I.
  5510.  
  5511. æKY GetListItem
  5512. æC      GetListItem -- display items for selection in a dialog box
  5513.  
  5514. GetListItem [option…] [[item…] | < file]
  5515.     -c[ancel]               # return a status of 0 even when cancel is clicked
  5516.     -d[efault] item         # item is entered in list and comes up selected
  5517.     -m[essage] message      # display message in dialog above the list
  5518.     -q[uote]                # don't quote items in the output
  5519.     -r[ows] rows            # make the list with this many rows
  5520.     -s[ingle]               # only allow a single selection
  5521.     -sort                   # sort input list
  5522.     -w[idth] width          # make the list this many pixels wide
  5523.  
  5524. Status codes returned:
  5525.   0    No errors (or Cancel button was clicked if  -c option is used).
  5526.   1    Syntax error (bad option).
  5527.   2    Cancel button was clicked.
  5528.  
  5529.                            Description
  5530.  
  5531.   Takes the items on the command line (or, if no items are present
  5532.   on the command line, items from standard input) and lists them in
  5533.   a dialog box. Items in the list can be selected with the mouse and
  5534.   modifier keys. Selected items are written to standard output when
  5535.   the OK button is clicked.
  5536.  
  5537.  
  5538.                              Examples
  5539.  
  5540.   Print `files -t TEXT | GetListItem -m “Select files to print:”`
  5541.  
  5542.   Lists all text files in the current directory and prints those selected
  5543.   by the user, as shown below.
  5544.  
  5545. æKY Help.MPW
  5546. æC                  Help -- write summary information
  5547.  
  5548. Help [-f helpfile] [command…]  > helpInformation
  5549.  -f helpfile             # alternate helpfile (default MPW.Help)
  5550.  
  5551. Status codes returned:
  5552.   0    Information was found for the given command.
  5553.   1    Syntax error.
  5554.   2    A command could not be found.
  5555.   3    The help file could not be opened.
  5556.  
  5557. æKY If
  5558. æC                 If -- conditional command execution
  5559.  
  5560. If expression
  5561.  command…
  5562. [Else If expression
  5563.  command… ] …
  5564. [Else
  5565.  command… ]
  5566. End
  5567.  
  5568. Status codes returned:
  5569.    0    None of the lists of commands were executed.
  5570.   –1    Invalid expression.
  5571.  
  5572.                            Description
  5573.  
  5574.   Executes the list of commands following the first expression whose
  5575.   value is nonzero. (Null strings are considered zero.) At most one
  5576.   list of commands is executed. You may specify any number of “Else
  5577.   If” clauses. The final Else clause is optional. The return characters
  5578.   (as shown above) or semicolons must appear at the end of each line.
  5579.  
  5580.   The pipe specification (|), conditional command terminators (&& and
  5581.   ||), and input/output specifications (<, >, >>, ≥, ≥≥, ∑, ∑∑) may
  5582.   appear following the End and apply to all of the commands in the
  5583.   list.
  5584.  
  5585.   For a definition of expression, see the description of the Evaluate
  5586.   command.
  5587.  
  5588.  
  5589.                              Examples
  5590.  
  5591.   If {Status} == 0
  5592.     Beep 1a,25,200
  5593.   Else
  5594.     Beep -3a,25,200
  5595.   End
  5596.  
  5597.   Produces an audible indication of the success or failure of the preceding
  5598.   command.
  5599.  
  5600.   For window in `Windows`
  5601.     If {window} != {Worksheet} AND {window} != {Active}
  5602.       Close {window}
  5603.     End
  5604.   End
  5605.  
  5606.   Closes all of the open windows except the active window and the Worksheet
  5607.   window. (Refer also to the Windows command.)
  5608.  
  5609.   The following commands, as a script, would implement a trivial case
  5610.   of a general “compile” command:
  5611.  
  5612.   If {1} =~ /≈.c/
  5613.     C {COptions} {1}
  5614.   Else If {1} =~ /≈.p/
  5615.     Pascal {POptions} {1}
  5616.   End
  5617.  
  5618.   If the above commands were saved in a file (say, as “Compile”), both
  5619.   C and Pascal programs could be compiled with the command
  5620.  
  5621.   Compile filename
  5622.  
  5623.  
  5624.                              See also 
  5625.  
  5626.   Evaluate command (for a description of expressions).
  5627.  
  5628.   “Structured Commands” in Chapter 5.
  5629.  
  5630. æKY Lib
  5631. æC           Lib -- combine object files into a library file
  5632.  
  5633. Lib [option…] objectFile…  ≥ progress
  5634.     -d                      # suppress duplicate definition warnings
  5635.     -df deleteFile          # delete modules listed in file deleteFile
  5636.     -dm name[,name]…        # delete external modules and entry points
  5637.     -dn name[,name]…        # delete external names, making them local
  5638.     -f                      # allow FORTRAN-style common data
  5639.     -mf                     # use MultiFinder temporary memory if necessary
  5640.     -o name                 # write object file name (default Lib.Out.o)
  5641.     -p                      # write progress information to diagnostics
  5642.     -rn OldNameA=NewNameA   # change module name(s) OldNameA to NewNameA,
  5643.       [,OldNameB=NewNameB]… #   OldNameB to NewNameB, etc.
  5644.     -sg newSeg=old[,old]…   # merge old segments into new segment
  5645.     -sn oldSeg=newSeg       # change segment name oldSeg to newSeg
  5646.     -sym [On | Full]        # keep symbolic information (default)
  5647.          [Off]              # discard symbolic information, can be followed by:
  5648.             [,NoLabels]     # discard label information
  5649.             [,NoLines]      # discard source line information
  5650.             [,NoTypes]      # discard type information
  5651.             [,NoVars]       # discard variable information
  5652.     -ver N                  # set OMF file version number to N
  5653.     -w                      # suppress warnings
  5654.  
  5655. Status codes returned:
  5656.   0    No problem.
  5657.   1    Syntax error.
  5658.   2    Fatal error.
  5659.  
  5660.                            Description
  5661.  
  5662.   Combines the specified object files into a single file. Input files
  5663.   must have type 'OBJ' .
  5664.  
  5665.   Lib is used for the following:
  5666.  
  5667.     • Combining object code from different languages into a single
  5668.     file.
  5669.  
  5670.     • Combining several object files into a larger object file (a
  5671.     library).
  5672.  
  5673.     • Combining several libraries into a single library, for use
  5674.     in building a particular application or desk accessory. This
  5675.     can greatly improve the performance of the Linker.
  5676.  
  5677.     • Deleting unneeded modules (with the -dm option), changing segmentation
  5678.     (the -sg and -sn options), or changing the scope of a symbol
  5679.     from external to local (the -dn option). (These options are useful
  5680.     when you construct a specialized library for linking a particular
  5681.     program.)
  5682.  
  5683.   Object files that have been processed with Lib result in significantly
  5684.   faster links when compared with the “raw” object files produced by
  5685.   the assembler or compilers.
  5686.  
  5687.   The output of Lib is logically equivalent to the concatenation of
  5688.   the input files, except for the optional renaming, resegmentation,
  5689.   and deletion operations, and the possibility of overriding an external
  5690.   name. The resolution of external names in Lib is identical to Link—in
  5691.   fact, the two programs share the same code for reading object files.
  5692.   Although multiple symbols are reduced to a single symbol, no combining
  5693.   of modules into larger modules is performed, and no cross-module
  5694.   references are resolved. This behavior guarantees that the Linker’s
  5695.   output will be the same size whether or not the output of Lib was
  5696.   used.
  5697.  
  5698.   See “Library Construction” in Chapter 10 of the MPW manual for a detailed 
  5699.   discussion of the behavior and use of Lib.
  5700.  
  5701.  
  5702.                              Examples
  5703.  
  5704.   Lib {CLibraries}≈ -o {CLibraries}CLibrary.o
  5705.  
  5706.   Combines all of the library object files from the {CLibraries} directory
  5707.   into a single library named CLibrary.o. For applications that require
  5708.   most or all of the C library files, using the new CLibrary file will
  5709.   reduce link time.
  5710.  
  5711.  
  5712.                              See also 
  5713.  
  5714.   Link, DumpObj, and DumpCode commands.
  5715.  
  5716.   “Optimizing Your Links” and “Library Construction” in Chapter 10.
  5717.  
  5718.   Appendix H.
  5719.  
  5720. æKY Line
  5721. æC                Line -- find line in the target window
  5722.  
  5723. Line n
  5724.  
  5725. Status codes can be returned by either the Find or the Open commands 
  5726. that make up the Line script:
  5727.   0    No errors.
  5728.   1    Syntax error.
  5729.   2    No target window; other error.
  5730.   3    System error.
  5731.  
  5732.                            Description
  5733.  
  5734.   Line finds line n in the target window. The parameter n is usually
  5735.   an integer, but may be any selection expression. The target window
  5736.   becomes the active (frontmost) window.
  5737.  
  5738.   Line is a script containing these two commands:
  5739.  
  5740.   Find {1} {target} # Find line n in the target window
  5741.  
  5742.   Open {target} # Bring the target window to the top
  5743.  
  5744.  
  5745.                              Examples
  5746.  
  5747.   Line 123
  5748.  
  5749.   Finds line 123 in the target window and makes the target window the
  5750.   new active window.
  5751.  
  5752.   ### Undefined symbol: length
  5753.  
  5754.   File Count.c; Line 75
  5755.  
  5756.   The File and Line commands above are part of an error message produced
  5757.   by the MPW C compiler. The MPW Assembler and MPW Pascal compilers
  5758.   produce errors when using similar formats. You can execute such error
  5759.   messages to find the line that contains the error.
  5760.  
  5761.   The command File is defined as an alias for Target in the Startup
  5762.   file. Thus File opens the specified file as the target window. Line
  5763.   then selects the offending line in the window and brings the window
  5764.   to the front. Notice that the remainder of the error message is a
  5765.   comment.
  5766.  
  5767.  
  5768.                              See also 
  5769.  
  5770.   Find command.
  5771.  
  5772. æKY Link
  5773. æC           Link -- link an application, tool, or resource
  5774.  
  5775. Link [option…] objectFile…  > map ≥ progress
  5776.  -ac alignment           # align code modules to 'n' byte boundaries
  5777.  -ad alignment           # align data modules to 'n' byte boundaries
  5778.  -c creator              # set resourceFile creator (default ????)
  5779.  -d                      # suppress duplicate definition warnings
  5780.  -da                     # desk accessory - add NULL to segment names
  5781.  -f                      # allow FORTRAN-style common data
  5782.  -l                      # write a location map to output
  5783.  -la                     # -l, include anonymous symbols in location map
  5784.  -lf                     # -l, include file and location of definitions
  5785.  -m mainEntry            # use mainEntry as main entry point
  5786.  -ma name=alias          # create an alias for module name
  5787.  -map                    # generate "friendly" link map
  5788.  -mf                     # use MultiFinder temporary memory if necessary
  5789.  -model far              # process 32-bit load-time relocatable references
  5790.  -model near             # prohibit 32-bit load-time relocatable references
  5791.  -msg keyword[,…]        # message options
  5792.      [no]dup             #   (suppress) warnings about duplicate symbols
  5793.      [no]multiple        #   (suppress) multiple undefined symbol reports
  5794.      [no]warn            #   (suppress) warning messages
  5795.  -o resourceFile         # write resourceFile (default Link.Out)
  5796.  -opt [Off]              # disable Object Pascal optimizations (default)
  5797.       [On ]              # enable optimizations
  5798.       [NoBypass]         # enable optimizations, but always dispatch
  5799.          [,Info]         #   write optimization information to diagnostics
  5800.          [,Names]        #   include MacsBug symbols within SelectorProc modules
  5801.  -p                      # write progress information to diagnostics
  5802.  -ra [seg]=attr[,attr…]  # set segment resource attributes:
  5803.      $xx (or) nnn        #   a hex or decimal attribute you figure out
  5804.      resSysHeap          #   or a comma-seperated list of resource
  5805.      resPurgeable        #    attributes by name
  5806.      resLocked           #   
  5807.      resProtected        #   
  5808.      resPreload          #   
  5809.      resChanged          #   (essentially ignored)
  5810.  -rn                     # don't include resource names in resourceFile
  5811.  -rt type[=id]           # set resource type and lowest id (default CODE=0)  
  5812.  -sg newSeg[=old[,old]…] # merge old segments into new segment
  5813.  -sn oldSeg=newSeg       # change segment name oldSeg to newSeg
  5814.  -srt                    # sort global data by "near" and "far" references
  5815.  -ss size                # maximum segment size (default 32760)
  5816.  -sym [Off]              # disable symbolic output (default)
  5817.          [On | Full]     # enable symbolic output, can be followed by:
  5818.          [,NoLabels]     #   omit label information
  5819.          [,NoLines]      #   omit source line information
  5820.          [,NoTypes]      #   omit type information
  5821.          [,NoVars]       #   omit variable information
  5822.  -t type                 # set resourceFile type (default APPL)
  5823.  -uf unrefFile           # write list of unreferenced modules to unrefFile
  5824.  -w                      # suppress warnings
  5825.  -wrap                   # when jump table space is exhausted, put excess jump table 
  5826.                          #   entries in global data space, if available
  5827.  -x crossRefFile         # write cross reference to crossRefFile
  5828.  
  5829. Status codes returned:
  5830.   0    No problem.
  5831.   1    Syntax error.
  5832.   2    Fatal error.
  5833.  
  5834.                            Description
  5835.  
  5836.   Links the specified object files into an application, tool, desk
  5837.   accessory, or driver. The input object files must have type 'OBJ'.
  5838.   Linked segments from the input object files are placed in code resources
  5839.   in the resource fork of the output file. The default output filename
  5840.   is Link.Out, but you can specify other names with the -o option.
  5841.  
  5842.   For detailed information about the linker, and instructions for linking
  5843.   applications, MPW tools, and desk accessories, see Chapters 8 and
  5844.   10 of the MPW manual. The first dialog box of Link’s Commando dialog is 
  5845.   reprinted here for convenience.
  5846.  
  5847.   The linker’s default action is to link an application, placing the
  5848.   output segments into 'CODE' resources. When you link an application,
  5849.   all old 'CODE' resources are deleted before the new 'CODE' resources
  5850.   are written. By default, resources created by the linker are given
  5851.   resource names that are the same as the corresponding segment names.
  5852.   You can change a resource (segment) name with the -sn or -sg options,
  5853.   and you can create unnamed resources with the -rn option.
  5854.  
  5855.   The linker executes in four phases:
  5856.  
  5857.     • Input phase: The linker reads all input files, finds all symbolic
  5858.     references and their corresponding definitions, and constructs
  5859.     a reference graph. Duplicate references are found and warnings
  5860.     are issued.
  5861.  
  5862.     • Analysis phase: The linker allocates and relocates code and
  5863.     data, detects missing references, and builds the jump table.
  5864.     If the -l or -x option is given, Link produces a linker map or
  5865.     cross-reference listing. The linker also eliminates unused code
  5866.     and data.
  5867.  
  5868.     • Output phase: The linker copies linked code segments into code
  5869.     resources in the resource fork of the output file. By default,
  5870.     these resources are given the same names as the corresponding
  5871.     segment names. (The cursor spins backward during this phase.)
  5872.  
  5873.     • Symbolic output phase: Optionally, Link may be used to create
  5874.     the .SYM file for use with SADE.
  5875.  
  5876.  
  5877.                              Examples
  5878.  
  5879.   Link Sample.p.o ∂
  5880.   “{PLibraries}”PInterface.o ∂
  5881.   “{PLibraries}”PasLib.o ∂
  5882.   “{Libraries}”Runtime.o ∂
  5883.   -o Sample ∂
  5884.   -la >Sample.map
  5885.  
  5886.   Links the main program file Sample.p.o with the libraries PInterface.o,
  5887.   PasLib.o, and Runtime.o, placing the output in Sample and placing
  5888.   the Linker map in the file Sample.map. Sample is an application that
  5889.   can be launched from the Finder or executed from MPW.
  5890.  
  5891.   Link -rt MROM=8 -c 'MPS ' -t ZROM -ss 140000 ∂
  5892.   -l > ROMLocListing -o MyROMImage {LinkList}
  5893.  
  5894.   Links the files defined in the Shell variable {LinkList} into a ROM
  5895.   image file, placing the output in the file MyROMImage. The segment
  5896.   size is set to 140,000 bytes, and the ROM is created as a resource
  5897.   'MROM' with ID=8. The file is typed as being created by MPW (creator
  5898.   'MPS '), with file type ZROM. Link’s location-ordered listing is
  5899.   placed in the file ROMLocListing.
  5900.  
  5901.   For additional examples, see “Link” in Chapter 10 and the makefiles
  5902.   in the Examples folders for the languages you are using.
  5903.  
  5904.  
  5905.                              See also 
  5906.  
  5907.   Lib command and Appendix H, “Object File Format.”
  5908.  
  5909.   Chapter 8, “The Build Process,” and Chapter 10, “Link.”
  5910.  
  5911.   The Segment Loader and the Resource Manager chapters in Inside Macintosh.
  5912.  
  5913.   Inside Macintosh, Volume IV, for information on the 128K ROM, the
  5914.   System Folder, and the Finder.
  5915.  
  5916. æKY LinkIIGS
  5917. æC                 LinkIIGS -- the MPW IIGS Linker
  5918. LinkIIGS [option…] objectFile… >listing ≥ progress
  5919.  -a name=alias      # symbol "name" will be changed to "alias"
  5920.  -apw               # convert normally ignored APW structures
  5921.  -at $xxxx          # set the auxilliary type of the output file to "$xxxx"
  5922.  -b                 # "big" link will be performed (less memory used by Linker)
  5923.  -b2                # "bigger" link will be performed (less memory used by Linker)
  5924.  -l                 # write summary information to standard output
  5925.  -lib libFile       # search library file "libFile" for undefined references and include
  5926.  -lseg loadsegName  # retarget the following object segments to Load Segment "loadsegName"
  5927.  -o outputFile      # output file is "outputfile" 
  5928.  -org $xxxx         # starting address of absolute Load Segment is "$xxxx"
  5929.  -p                 # write progress to diagnostic output
  5930.  -path pathname     # pathname prefix to be used in Pathname Table Segment
  5931.  -r                 # set reload bit in Load Segments "~globals" and "~arrays"
  5932.  -s                 # symbol table is sorted and printed to standard output
  5933.  -stamp             # put time/date stamps in Pathname Table Segment
  5934.  -t $xx             # set the file type of the output file to "$xx"
  5935.  -w                 # warning messages are not displayed
  5936.  -w2                # warnings are treated as fatal errors
  5937.  -x                 # output Load File will not be in ExpressLoad format
  5938. æKY Loop
  5939. æC                 Loop -- repeat commands until Break
  5940.  
  5941. Loop
  5942.  command…
  5943. End
  5944.  
  5945. Loop returns the status of the last command executed.
  5946.  
  5947.                            Description
  5948.  
  5949.   Executes the enclosed commands repeatedly. The Break command is used
  5950.   to terminate the loop. The Continue command can be used to terminate
  5951.   the current iteration of the loop.
  5952.  
  5953.   The pipe specification (|), conditional command terminators (&& and
  5954.   ||), and input/output specifications (<, >, >>, ≥, ≥≥, ∑, and ∑∑)
  5955.   may appear following the End, and apply to all of the commands in
  5956.   the list.
  5957.  
  5958.  
  5959.                              Examples
  5960.  
  5961.   The following script runs a command several times, once for each
  5962.   parameter:
  5963.  
  5964.   ### Repeat - Repeat a command for several parameters ###
  5965.  
  5966.   # Syntax:
  5967.  
  5968.   # Repeat command parameter…
  5969.  
  5970.   #
  5971.  
  5972.   # Execute command once for each parameter in the parameter
  5973.  
  5974.   # list. Options can be specified by including them with
  5975.  
  5976.   # the command name in quotes.
  5977.  
  5978.   #
  5979.  
  5980.   Set cmd {1}
  5981.  
  5982.   Loop
  5983.  
  5984.   Shift
  5985.  
  5986.   Break If {1} ==
  5987.  
  5988.   {cmd} {1}
  5989.  
  5990.   End
  5991.  
  5992.   Notice that Shift is used to step through the parameters, and that
  5993.   Break ends the loop when all parameters have been used.
  5994.  
  5995.  
  5996.                              See also 
  5997.  
  5998.   Break, For, and Continue commands.
  5999.  
  6000.   “Structured Commands” in Chapter 5.
  6001.  
  6002. æKY Make
  6003. æC             Make -- build up-to-date version of a program
  6004.  
  6005. Make [option…] target…   > commands ≥ progress
  6006.  -d name[=value]         # define variable name as value (overrides makefile)
  6007.  -e                      # rebuild everything regardless of dates
  6008.  -f makefile             # read dependencies from makefile (default MakeFile)
  6009.  -p                      # write progress information to diagnostics
  6010.  -r                      # write roots of dependency graph to output
  6011.  -s                      # write structure of target dependencies to output
  6012.  -t                      # touch dates of targets and prerequisites
  6013.  -u                      # identify targets in makefile not reached in build
  6014.  -v                      # write verbose explanations to diagnostics
  6015.  -w                      # suppress warnings
  6016.  -y                      # like -v, but omit announcing up-to-date targets
  6017.  
  6018.  
  6019. Status codes returned:
  6020.   0    Successful completion.
  6021.   1    Parameter or option error.
  6022.   2    Execution error.
  6023.  
  6024.                            Description
  6025.  
  6026.   Generates a set of Shell commands that you can execute to build up-to-date
  6027.   versions of the specified target files. (If no target is specified,
  6028.   the target on the left side of the first dependency rule in the makefile
  6029.   is built.) Make allows you to rebuild only those components of a
  6030.   program that require rebuilding. Make determines which components
  6031.   need rebuilding by reading a makefile. This is a text file that describes
  6032.   dependencies between the components of a program, along with the
  6033.   Shell commands needed to rebuild each component. You can specify
  6034.   makefiles with the -f option. After processing the makefiles, Make
  6035.   writes to standard output the appropriate set(s) of commands needed
  6036.   to rebuild the target(s).
  6037.  
  6038.   See “Format of a Makefile” in Chapter 9 of the MPW manual for a 
  6039.   description of the format of a makefile. The first dialog box of Make’s 
  6040.   Commando dialog is reproduced here for convenience.
  6041.  
  6042.   Make executes in two phases:
  6043.  
  6044.     • In the first phase, Make reads the makefile(s) and creates
  6045.     a file (target) dependency graph. (The “beachball” cursor spins
  6046.     counterclockwise during this phase.)
  6047.  
  6048.     • In the second phase, Make generates the build commands for
  6049.     the target to be built (the cursor spins clockwise). If a target
  6050.     file doesn’t exist or if it depends on files that are out-of-date
  6051.     or newer than the target, Make writes out the appropriate command
  6052.     lines for updating the target file. This process is recursive
  6053.     and “bottom up” so that commands are issued first for those lower-level
  6054.     dependencies that need to be rebuilt.
  6055.  
  6056.   You can execute the generated build commands after Make is done executing.
  6057.  
  6058.  
  6059.                              Examples
  6060.  
  6061.   Make -p -f MakeFile Sample
  6062.  
  6063.   Makes the target file Sample, and prints progress information. Sample’s
  6064.   dependency relations are described in the makefile :AExamples:MakeFile.
  6065.  
  6066.   Sample ƒƒ Sample.r
  6067.       Rez Sample.r -o Sample -a
  6068.       SetFile -a B Sample -c ASMP -t APPL #set bundle bit
  6069.  
  6070.   Sample ƒƒ Sample.r Sample.a.o
  6071.       Link Sample.a.o -o Sample
  6072.  
  6073.   Sample.a.o ƒ Sample.a
  6074.       Asm Sample.a
  6075.  
  6076.   The ƒ (Option-F) character means “is a function of”—that is, the
  6077.   file on the left side depends on the files on the right side. If
  6078.   the files on the right are newer, the subsequent Shell commands are
  6079.   written to standard output. (See Chapter 9 for details.)
  6080.  
  6081.  
  6082.                              See also 
  6083.  
  6084.   “Format of a Makefile” in Chapter 9 for the format of a makefile,
  6085.   examples, and other information about using Make.
  6086.  
  6087.   Makefiles for building sample programs are contained in the Examples
  6088.   folders:
  6089.  
  6090.     • Examples:AExamples:Makefile
  6091.  
  6092.     • Examples:PExamples:Makefile
  6093.  
  6094.     • Examples:CExamples:Makefile
  6095.  
  6096. æKY MakeBinIIGS
  6097. æC           MakeBinIIGS -- converts Load files to Binary files
  6098. MakeBinIIGS [option…] loadfile [-o binfile] >listing ≥ progress
  6099.  loadfile    # Full or partial pathname of the load file you wish to convert.
  6100.  binfile     # Full or partial pathname to be assigned to the binary file.  If
  6101.              # you omit this parameter, the load file name is used and
  6102.              # loadfile is overwritten.
  6103.  -org=val    # The binary file is given a fixed start location at val and all
  6104.              # code is relocated for execution starting at val.  You can use
  6105.              # a decimal number for val, or you can specify a hexadecimal
  6106.              # number by preceding val with a dollar sign ($).  If you omit
  6107.              # this parameter, loadfile is relocated to start at $2000.
  6108.  -p          # progress report is printed
  6109.  -s          # summary report is printed
  6110.  -t $xx      # sets the output file type to $xx
  6111.  -at $xxxx   # sets the output file auxtype to $xxxx
  6112.  
  6113. æKY MakeErrorFile
  6114. æC            MakeErrorFile -- create error message textfile
  6115.  
  6116. MakeErrorFile [option…] [file…]  < file > listing ≥ progress
  6117.  -l                      # write listing to standard output
  6118.  -o file/dir             # output file or directory
  6119.  -p                      # write progress information to diagnostics
  6120.  
  6121. Status codes returned:
  6122.   0    No errors.
  6123.   1    Syntax error.
  6124.   2    Error in processing.
  6125.  
  6126.                            Description
  6127.  
  6128.   MakeErrorFile creates specially formatted error message files used
  6129.   to retrieve the error messages associated with error numbers. The
  6130.   ErrMgr unit in the ToolLibs.o library is used by programs to access
  6131.   the error files created by MakeErrorFile. SysErrs.Err is one such
  6132.   error file; it is used by various MPW tools to get the textual messages
  6133.   associated with Macintosh system error codes. See the documentation
  6134.   on the ErrMgr unit for more information on how error files are accessed.
  6135.  
  6136.  
  6137.                              Examples
  6138.  
  6139.   MakeErrorFile SysErrs -l >SysErrsList
  6140.  
  6141.   Writes an ordered list of system error numbers and messages to the
  6142.   file SysErrsList.
  6143.  
  6144.  
  6145. æKY MakeLibIIGS
  6146. æC               MakeLibIIGS -- creates Library files
  6147. MakeLibIIGS -c -d -f -l <filename> -o <filename> -r -x  <filename>… >listing ≥ progress
  6148.  -c             # convert from version 1 OMF to version 2 OMF
  6149.  -d             # delete the file names from the library
  6150.  -f             # list library contents to stdout
  6151.  -l <filename>  # specify the source library. If not -o, also the destination
  6152.  -o <filename>  # specify the destination library.
  6153.  -r             # replace <filename>s in the specified library
  6154.  -x             # extract <filename>s from the specified library
  6155. æKY Mark
  6156. æC                Mark -- assign a marker to a selection
  6157.  
  6158. Mark [-y | -n] selection name [window]
  6159.  -y                      # replace existing marker (avoids dialog)
  6160.  -n                      # don't replace existing marker (avoids dialog)
  6161.  
  6162. Status codes returned:
  6163.   0    No errors.
  6164.   1    Syntax error.
  6165.   2    Error in processing.
  6166.   3    System error.
  6167.  
  6168.                            Description
  6169.  
  6170.   Mark assigns the marker name to the range of text specified by the
  6171.   selection in window. If no window is specified, the command operates
  6172.   on the target window (the second window from the front). The new
  6173.   marker name is included in the Mark menu when window is the current
  6174.   active window. A marker is associated with a logical, as opposed
  6175.   to absolute, range of text. The ranges of markers may overlap, but
  6176.   each marker must have a unique name. Marker names are case sensitive.
  6177.  
  6178.   A dialog box requests confirmation if the marker name conflicts with
  6179.   an existing marker name. The -y or -n option can be used in scripts
  6180.   to avoid this interaction.
  6181.  
  6182.   Deletion and insertion operations affect markers according to these
  6183.   rules:
  6184.  
  6185.     • Any editing outside the range of a marker will not affect the
  6186.     logical range of the marker, where “outside” means that the range
  6187.     of editing changes does not intersect the range of the marker.
  6188.  
  6189.     • Any editing inside the range of a marker will change the logical
  6190.     range of the marker by the amount of the editing change. For
  6191.     example, adding ten characters to the inside of a marker’s range
  6192.     will increase the range of the marker by ten characters. Another
  6193.     way to say this is that a marker has responsibility for all the
  6194.     characters added to (or deleted from) its range.
  6195.  
  6196.     • Any deletion that totally encloses a marker will delete the
  6197.     marker.
  6198.  
  6199.  
  6200.                              Examples
  6201.  
  6202.   Mark § 'Procedure 1'
  6203.  
  6204.   Assigns a marker with the name “Procedure 1” to the current selection
  6205.   in the target window.
  6206.  
  6207.   Limitation It is currently not possible to “Undo” the effects of
  6208.   any editing operations on markers.
  6209.  
  6210.  
  6211.                              See also 
  6212.  
  6213.   Unmark and Markers commands.
  6214.  
  6215.   “Mark Menu” in Chapter 3.
  6216.  
  6217.   “Markers” in Chapter 6.
  6218.  
  6219. æKY Markers
  6220. æC                        Markers -- list markers
  6221.  
  6222. Markers [-q] [window]
  6223.  -q                      # don't quote the marker names
  6224.  
  6225. Status codes returned:
  6226.   0    No errors.
  6227.   1    Syntax error.
  6228.   2    Error in processing.
  6229.   3    System error.
  6230.  
  6231.                            Description
  6232.  
  6233.   Markers prints the names of all markers associated with window. The
  6234.   names are written one per line, and they are ordered from the beginning
  6235.   to the end of the window.
  6236.  
  6237.  
  6238.                              Examples
  6239.  
  6240.   Markers {Target}
  6241.  
  6242.   Lists all markers associated with the target window.
  6243.  
  6244.  
  6245.                              See also 
  6246.  
  6247.   “Mark Menu” in Chapter 3.
  6248.  
  6249.   “Markers” in Chapter 6.
  6250.  
  6251. æKY MatchIt
  6252. æC   MatchIt -- semi-intelligent language sensitive bracket matcher
  6253.  
  6254. MatchIt [-a[sm] | -p[ascal] | -c] [-h] [-l] [-n] [-v] [window]
  6255.  -a[sm]                  # target language is Assembler
  6256.  -p[ascal]               # target language is Pascal
  6257.  -c                      # target language is C
  6258.  -h                      # highlight all characters enclosed by match
  6259.  -l                      # highlight entire lines containing match
  6260.  -n                      # generate error message if no match
  6261.  -v                      # display MatchIt's version number
  6262.  
  6263. Status codes returned:
  6264.   0    Normal termination.
  6265.   1    Parameter or option error.
  6266.   3    Matching delimiter not found (only if -n option specified).
  6267.  
  6268.                            Description
  6269.  
  6270.   Matches C, Pascal, and assembly-language delimiters with their mates
  6271.   in the specified window. The default window is the target window
  6272.   (second from front). The characters highlighted as the current selection1
  6273.   in the window are used as the left delimiter. MatchIt attempts to
  6274.   find the corresponding right mate for the selected delimiter.
  6275.  
  6276.   MatchIt is syntax sensitive, so that it is semi-intelligent about
  6277.   how it finds the matching delimiter. For example, if a Pascal BEGIN
  6278.   is the specified selection, MatchIt finds the proper END that matches
  6279.   it. All commenting conventions, strings, nesting, and so on are taken
  6280.   into account when searching for the end delimiter.
  6281.  
  6282.   The functionality of MatchIt is similar to the Shell editor’s ability
  6283.   to find mates for the characters ( [ { and '' when you double-click
  6284.   any of these characters. However, MatchIt differs from the Shell
  6285.   editor by supporting even more delimiters and using the knowledge
  6286.   of the target language syntax to find the proper match. The following
  6287.   table summarizes all the delimiters supported and for which languages:
  6288.  
  6289.  
  6290.                              Examples
  6291.  
  6292.   matchit  mysource.p
  6293.  
  6294.   For the current selected delimiter in the open window mysource.p,
  6295.   find the delimiter's mate. The language is assumed to be Pascal (because
  6296.   of the .p suffix.). No message is reported and the selection is not
  6297.   changed if the mate cannot be found. Of course, errors are still
  6298.   reported to diagnostic output if the input selection is not a valid
  6299.   Pascal delimiter (according to the table in “Options”). If MatchIt
  6300.   is to be used explicitly, a more general form for its use is shown
  6301.   in this example:
  6302.  
  6303.   matchit  -n  “{target}”
  6304.  
  6305.   For the current selected delimiter in the open target window, find
  6306.   the delimiter’s mate. The “{target}” specification could have been
  6307.   omitted, as it is MatchIt’s default. If explicitly specified, as
  6308.   shown here, it is best to quote it. The language is determined by
  6309.   the window’s name suffix (if present), or by the the selection, if
  6310.   the suffix is not acceptable to MatchIt. An error is reported if
  6311.   the mate cannot be found (-n).
  6312.  
  6313.   While the second example is more general than the first, and either
  6314.   might be useful for Shell scripts (particularly when the -n option
  6315.   is used), the real use for MatchIt is as a generalization of the
  6316.   the Shell editor’s own double-clicking delimiter matching mechanism.
  6317.   The following example illustrates this purpose:
  6318.  
  6319.   addmenu Edit 'Match It/µ' 'matchit  -n -h ∂
  6320.   “{active}”  ≥ “{MPW}”Errors || ∂
  6321.   alert  < “{MPW}”Errors'
  6322.  
  6323.   This example places a MatchIt call into the Edit menu as the command
  6324.   Match It with a command key Option-m (the µ). A selection is made
  6325.   in the current (that is, the {active}) window and the menu command
  6326.   invoked (by pressing Command-Option-m). If the match is found, all
  6327.   characters from the initially selected delimiter to its mate are
  6328.   highlighted (-h). If a match is not found, or if any other errors
  6329.   occur, an alert dialog box appears containing the error message.
  6330.   An auxiliary file, “{MPW}”Errors, is used for this purpose.
  6331.  
  6332.   Of course, you might not be interested in displaying the dialog box
  6333.   because you can see that the selection doesn’t change if there are
  6334.   any errors. Furthermore, you might not want superfluous files laying
  6335.   around (“{MPW}”Errors—although you could create a more elaborate
  6336.   AddMenu command to always delete this file). Thus, you could make
  6337.   the following simplification:
  6338.  
  6339.   addmenu Edit 'Match It/µ' 'matchit  -h  “{active}”  ≥ dev:null'
  6340.  
  6341.   This example places a MatchIt call into the Edit menu but with all
  6342.   errors ignored when the MatchIt command is executed.
  6343.  
  6344.   Limitations MatchIt does not process conditionals (that is, Pascal
  6345.   $ifc, C #if, and so on) during its scan except to find matching pairs.
  6346.   This might confuse MatchIt’s scanning process. Similarily, C macros
  6347.   and “\” continuations may also confuse MatchIt.
  6348.  
  6349.   MatchIt only finds a right delimiter to the specified left delimiter.
  6350.   Right-to-left matching is not supported.
  6351.  
  6352. æKY MergeBranch
  6353. æC        MergeBranch -- merge a branch revision onto the trunk
  6354.  
  6355. MergeBranch file…
  6356.  
  6357. Status codes returned:
  6358.   0    No Errors.
  6359.   1    Syntax Error.
  6360.   2    Error in Processing.
  6361.   3    System Error.
  6362.  
  6363.                            Description
  6364.  
  6365.   Merge the branch revision of the HFS file file onto the trunk. The
  6366.   file must belong to a currently mounted project and must be a branch
  6367.   revision (that is, the revision number contains one or more letters).
  6368.  
  6369.   MergeBranch uses the ProjectInfo command to determine what project
  6370.   file belongs to and whether file is in fact a branch revision. If
  6371.   all of the file's revisions are older than the branch, the branch
  6372.   will be checked in as the latest trunk revision. Otherwise MergeBranch
  6373.   checks out the latest revision on the trunk and calls CompareFiles
  6374.   to allow the user to manually cut and paste changes from the branch
  6375.   into the trunk revision. When done, the user can check the modified
  6376.   trunk revision back into the project.
  6377.  
  6378.   MergeBranch uses the CompareFiles script.
  6379.  
  6380.  
  6381.                              Examples
  6382.  
  6383.   MergeBranch file.c
  6384.  
  6385.   This example merges the branch revision in the file “file.c” onto
  6386.   the trunk.
  6387.  
  6388.   AddMenu Project 'Merge Branch' 'Merge Branch {Active} ∑∑ {WorkSheet}'
  6389.  
  6390.   This example adds MergeBranch to the Project menu and allows you
  6391.   to merge branch revisions onto the trunk.
  6392.  
  6393.  
  6394.                              See also 
  6395.  
  6396.   CompareFiles.
  6397.  
  6398. æKY ModifyReadOnly
  6399. æC  ModifyReadOnly -- enables a read-only Projector file to be edited
  6400.  
  6401. ModifyReadOnly file …
  6402.  
  6403. Status codes returned:
  6404.   0    No errors.
  6405.   1    Syntax error.
  6406.   2    Error in processing.
  6407.  
  6408.                            Description
  6409.  
  6410.   Write-enable a file that has been checked out as read-only. After
  6411.   executing this command on a file, the modified read-only icon is
  6412.   displayed in the window.
  6413.  
  6414.   This command is most useful on those rare occasions when you need
  6415.   to modify a read-only file. For example, suppose you have taken a
  6416.   number of modifiable files home. You may have also brought along
  6417.   certain read-only copies of files that you did not expect to modify,
  6418.   but once you get into your work at home you discover that you do,
  6419.   after all, need to make changes in these files.
  6420.  
  6421.   Note that this command takes only a single file for a parameter.
  6422.   This “feature” was intentional so that this command would not be
  6423.   overused.
  6424.  
  6425.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  6426.   symbols used in Projector commands.
  6427.  
  6428.  
  6429.                              Examples
  6430.  
  6431.   Suppose file.c is checked out as read-only. You can write-enable
  6432.   it by using the ModifyReadOnly command:
  6433.  
  6434.   ModifyReadOnly file.c
  6435.  
  6436.   ProjectInfo :file.c -s
  6437.  
  6438.   The ProjectInfo command writes the following to standard output:
  6439.  
  6440.   file.c,5*
  6441.  
  6442.   Notice that an asterisk appears after the revision number when you
  6443.   get information about modified read-only files.
  6444.  
  6445.  
  6446.                              See also 
  6447.  
  6448.   CheckIn, CheckOut, CheckOutDir.
  6449.  
  6450. æKY Mount
  6451. æC                        Mount -- mount volumes
  6452.  
  6453. Mount drive…
  6454.  
  6455. Status codes returned:
  6456.   0    The disk was mounted.
  6457.   1    Syntax error.
  6458.   2    An error occurred.
  6459.  
  6460.                            Description
  6461.  
  6462.   Mounts the disks in the specified drives, making them accessible
  6463.   to the file system. Drive is the drive number.
  6464.  
  6465.   Mounting is normally automatic when a disk is inserted. The Mount
  6466.   command is needed for mounting multiple hard disks, which cannot
  6467.   be “inserted,” or for volumes that have been unmounted via the Unmount
  6468.   command.
  6469.  
  6470.  
  6471.                              Examples
  6472.  
  6473.   Mount 1
  6474.  
  6475.   Mounts the disk in drive 1 (the internal drive).
  6476.  
  6477.  
  6478.                              See also 
  6479.  
  6480.   Unmount and Volumes commands.
  6481.  
  6482. æKY MountProject
  6483. æC                    MountProject -- mount projects
  6484.  
  6485. MountProject ([-s] [-pp] [-q] [-r]) | [Project]
  6486.  -s                      # print names only, not commands
  6487.  -pp                     # list mounted projects using project paths
  6488.  -q                      # don't quote names with special characters
  6489.  -r                      # list projects recursively
  6490.  
  6491. Status codes returned:
  6492.   0    No errors.
  6493.   1    Syntax error.
  6494.   2    Error in processing.
  6495.   3    System error.
  6496.  
  6497.                            Description
  6498.  
  6499.   MountProject mounts (establishes a connection to) the specified project.
  6500.   Project is the HFS path of the project directory for the project.
  6501.   Once a project is mounted, that project and all its subprojects can
  6502.   be accessed.
  6503.  
  6504.   MountProject commands typically appear in the UserStartup file, a
  6505.   script, or an AddMenu to automatically mount the projects you typically
  6506.   access.
  6507.  
  6508.   If project is omitted, a list of all root projects is written to
  6509.   standard output in the form of MountProject commands.
  6510.  
  6511.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  6512.   symbols used in Projector commands.
  6513.  
  6514.  
  6515.                              Examples
  6516.  
  6517.   MountProject FS:Zoom
  6518.   MountProject HD:localProjects:Test
  6519.  
  6520.   These commands mount the projects Zoom and Test.
  6521.  
  6522.   MountProject
  6523.   MountProject FS:MPW
  6524.   MountProject HD:localProjects:sort
  6525.  
  6526.   To obtain a list of the current root projects, execute the MountProject
  6527.   command without parameters.
  6528.  
  6529.  
  6530.                              See also 
  6531.  
  6532.   UnmountProject, Project, CheckOutDir.
  6533.  
  6534. æKY Move
  6535. æC                  Move -- move files and directories
  6536.  
  6537. Move [-y | -n | -c] [-p] name… target  ≥ progress
  6538.  -y                      # overwrite target files (avoids dialog)
  6539.  -n                      # don't overwrite target files (avoids dialog)
  6540.  -c                      # cancel if conflict occurs (avoids dialog)
  6541.  -p                      # write progress information to diagnostics
  6542.  
  6543. Status codes returned:
  6544.   0    All objects were moved.
  6545.   1    Syntax error.
  6546.   2    An error occurred during the move.
  6547.   4    Cancel was selected or implied with the -c option.
  6548.  
  6549.                            Description
  6550.  
  6551.   Moves name to targetName. (Name and targetName are file or directory
  6552.   names.) If targetName is a directory, one or more objects (files
  6553.   and/or directories) are moved into that directory. If targetName
  6554.   is a file or doesn’t exist, file or directory name replaces targetName.
  6555.   In either case, the old objects are deleted. Moved objects retain
  6556.   their current creation and modification dates.
  6557.  
  6558.   If a directory is moved, its contents, including all subdirectories,
  6559.   are also moved. No directory moved can be a parent of targetName.
  6560.  
  6561.   A dialog box requests a confirmation if the move would overwrite
  6562.   an existing file or folder. The -y, -n, or -c option can be used
  6563.   to avoid this interaction.
  6564.  
  6565.  
  6566.                              Examples
  6567.  
  6568.   Move Startup Suspend Resume Quit {SystemFolder}
  6569.  
  6570.   Moves the four files from the current directory to the System Folder.
  6571.  
  6572.   Move File ::
  6573.  
  6574.   Moves File from the current directory to the enclosing (parent) directory.
  6575.  
  6576.   Move -y File1 File2
  6577.  
  6578.   Moves File1 to File2, overwriting File2 if it exists. (This is the
  6579.   same as renaming the file.)
  6580.  
  6581.  
  6582.                              See also 
  6583.  
  6584.   Duplicate and Rename commands.
  6585.  
  6586.   “File and Window Names” in Chapter 4.
  6587.  
  6588.   “Filename Generation” in Chapter 5.
  6589.  
  6590. æKY MoveWindow
  6591. æC                 MoveWindow -- move window to h,v location
  6592.  
  6593. MoveWindow [h v] [-i] [window]
  6594.  h                       # horizontal position of top left corner
  6595.  v                       # vertical position of top left corner
  6596.  -i                      # ignore positioning errors
  6597.  
  6598. Status codes returned:
  6599.   0    No errors.
  6600.   1    Syntax error (error in parameters).
  6601.   2    The specified window does not exist.
  6602.   3    The h v location specified is invalid.
  6603.  
  6604.                            Description
  6605.  
  6606.   Moves the upper-left corner of the specified window to the location
  6607.   (h v), where h and v are horizontal and vertical integers, respectively.
  6608.   Use a space to separate the numbers h and v on the command line.
  6609.  
  6610.   The coordinates (0,0) are located at the left side of the screen
  6611.   at the bottom of the menu bar. If the location specified would place
  6612.   the window’s title bar entirely off the visible screen, an error
  6613.   is returned. (The -i option overrides the error.) If no window is
  6614.   specified, the target window (the second window from the front) is
  6615.   assumed. If no location is specified, the specified window’s location
  6616.   is returned without any effect on the window.
  6617.  
  6618.  
  6619.                              Examples
  6620.  
  6621.   MoveWindow 72 72
  6622.  
  6623.   Moves the target window’s upper-left corner to a point approximately
  6624.   one inch in from the upper-left corner of the screen, and one inch
  6625.   below the bottom of the menu bar. (There are about 72 pixels per
  6626.   inch on the Macintosh display screen.)
  6627.  
  6628.   MoveWindow
  6629.  
  6630.   Returns MoveWindow 72 72 when executed after the above example.
  6631.  
  6632.   MoveWindow 0 0 {Worksheet}
  6633.  
  6634.   Moves the Worksheet window to the upper-left corner of the screen
  6635.   (below the menu bar).
  6636.  
  6637.  
  6638.                              See also 
  6639.  
  6640.   SizeWindow, StackWindows, RotateWindows, TileWindows, and ZoomWindow
  6641.   commands.
  6642.  
  6643. æKY NameRevisions
  6644. æC                NameRevisions -- define a symbolic name
  6645.  
  6646. NameRevisions [-u User] [-project Project] [-public |private | -b] [-r]
  6647.      [[-only] | name [[-expand] [-s] | [-replace] [-dynamic] [names… | -a]]]
  6648.  -u user                 # name of current user
  6649.  -private                # create a private name
  6650.  -project project        # name of project that contains the revisions
  6651.  -public                 # create a public name
  6652.  -b                      # print both public and private names
  6653.  -expand                 # evaluate names to revision level before printing
  6654.  -only                   # only print the names, not the associated revisions
  6655.  -replace                # completely overwrite the previous definition of name
  6656.  -dynamic                # evaluate names to revision level when using not defining
  6657.  -r                      # recursively execute NameRevisions starting with current project
  6658.  -s                      # print a single name per line
  6659.  -a                      # all the files in the project
  6660.  
  6661. Status codes returned:
  6662.   0    No errors.
  6663.   1    Syntax error.
  6664.   2    Error in processing.
  6665.   3    System error.
  6666.  
  6667.                            Description
  6668.  
  6669.   Create a symbolic name to represent a set of revisions under Projector.
  6670.   Subsequently, when name is used in Projector commands, its value,
  6671.   names, is substituted in its place. Symbolic names are kept on a
  6672.   per-project basis and can be composed of filenames, revisions, branches,
  6673.   and other defined symbolic names. A symbolic name can include only
  6674.   one revision per file. The first character of a Name cannot be a
  6675.   digit (0–9). Also, commas, greater-than or less-than signs, (<, <,
  6676.   > >), or hyphens (-) are not allowed anywhere in a Name. Names are
  6677.   not case sensitive.
  6678.  
  6679.   If names is missing, the definition for name is listed. If name is
  6680.   missing, then NameRevisions lists all symbolic names in the project.
  6681.   In either case, the output is in the form of NameRevisions commands.
  6682.  
  6683.   By default, if names currently refers to a file listed in name, the
  6684.   revision for the file in name is modified to be the revision associated
  6685.   with the file in names. If there is a file in names which is not
  6686.   currently referred to by name, that file and revision is appended
  6687.   to name. To replace the definition of name, include the
  6688.  
  6689.   -replace option.
  6690.  
  6691.   The default is to create a private symbolic name. Include the -public
  6692.   option to make the symbolic name available to all users. You can
  6693.   add definitions for private symbolic names to UserStartup. Public
  6694.   symbolic name are stored with the project so they need to be defined
  6695.   only once. Do not put public symbolic name definitions in UserStartup.
  6696.  
  6697.   Projector checks for various errors both when a symbolic name is
  6698.   defined and when it is used. Errors include referring to a nonexistent
  6699.   file or referring to more than one revision in a file.
  6700.  
  6701.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  6702.   symbols used in Projector commands.
  6703.  
  6704.  
  6705.                              Examples
  6706.  
  6707.   Assuming the latest revisions of the files file.c and interactive.c
  6708.   are 9 and 13 respectively, the first example defines a symbolic name
  6709.   “Work” that always expands to the files file.c,9 and interactive.c,13.
  6710.  
  6711.   NameRevisions Work file.c interactive.c
  6712.  
  6713.   The following command:
  6714.  
  6715.   CheckOut Work
  6716.  
  6717.   Is equivalent to:
  6718.  
  6719.   CheckOut file.c,9 interactive.c,13
  6720.  
  6721.   By omitting the Names parameter, the next NameRevisions command generates
  6722.   the current definition of Work.
  6723.  
  6724.   NameRevisions Work
  6725.   NameRevisions Work file.c,9 interactive.c,13
  6726.  
  6727.   The -dynamic is an important option. The following two commands illustrate
  6728.   its function:
  6729.  
  6730.   NameRevisions fred file.c
  6731.   NameRevisions -dynamic fred file.c
  6732.  
  6733.   The first command defines a symbolic name “fred” that always expands
  6734.   to the latest revision of file.c when fred was defined. The second
  6735.   example expands to the latest revision at the time of use. If the
  6736.   latest revision of file.c at the time fred was defined was 7 and
  6737.   the current latest revision is 9, the second NameRevisions command
  6738.   is equivalent to
  6739.  
  6740.   NameRevisions fred file.c,9
  6741.  
  6742.   The next command creates the symbolic name “file.c” that expands
  6743.   to the second revision off the first branch off the 1.1 revision
  6744.   of file.c.
  6745.  
  6746.   NameRevisions file.c file.c,1.1a2
  6747.  
  6748.   The command
  6749.  
  6750.   CheckOut file.c
  6751.  
  6752.   checks out revision 1.1a2 of file.c. The next example creates a Name
  6753.   “file.c” that expands to the latest version of the first branch off
  6754.   the 1.1 revision of file.c.
  6755.  
  6756.   NameRevisions -dynamic file.c file.c,1.1a
  6757.  
  6758.   So the checkout command
  6759.  
  6760.   CheckOut file.c
  6761.  
  6762.   will check out the latest revision on the first branch off revision
  6763.   1.1 of file.c.
  6764.  
  6765.   The next example defines all the latest revisions in the project
  6766.   Kerfroodi to be part of “v1.0 B1”. Because this a global name, all
  6767.   users accessing the Kerfroodi project will be able to use the name
  6768.   “v1.0 B1”.
  6769.  
  6770.   NameRevisions -public “vB1 1.0” -project Kerfroodi -a
  6771.  
  6772.   The name “BetaRelease” is defined recursively for all projects within
  6773.   the Zoom project:
  6774.  
  6775.   NameRevisions -project Zoom∫ -r “BetaRelease” -a
  6776.  
  6777.   Its behavior is the same as executing the following commands individually:
  6778.  
  6779.   NameRevisions -project Zoom “BetaRelease” -a
  6780.   NameRevisions -project Zoom∫Vroom “BetaRelease” -a
  6781.   NameRevisions -project Zoom∫Utilities “BetaRelease” -a
  6782.   NameRevisions -project Zoom∫Utilities∫Port “BetaRelease” -a
  6783.   ...
  6784.  
  6785.  
  6786.                              See also 
  6787.  
  6788.   ProjectInfo, DeleteNames.
  6789.  
  6790. æKY New
  6791. æC                       New -- open a new window
  6792.  
  6793. New [name…]
  6794.  
  6795. Status codes returned:
  6796.   0    No errors.
  6797.   1    Syntax error (error in parameters).
  6798.   2    Unable to complete operation; a file with the specified name already exists.
  6799.   3    System error.
  6800.  
  6801.                            Description
  6802.  
  6803.   Opens a new window as the active (frontmost) window. If name is not
  6804.   specified, the Shell generates a unique name for the new window,
  6805.   of the form “Untitled-n”, where n is a decimal number. If name already
  6806.   exists, an error results.
  6807.  
  6808.   You can use New to open several new windows by specifying a list
  6809.   of names separated by spaces. Note that New differs from Open -n
  6810.   by returning an error if the file already exists, whereas Open -n
  6811.   either opens an existing file or creates a new file.
  6812.  
  6813.   If the Shell variable {NewWindowRect} is defined, the windows are
  6814.   opened to that size and location.
  6815.  
  6816.  
  6817.                              Examples
  6818.  
  6819.   New
  6820.  
  6821.   Opens a new window with a Shell-generated name.
  6822.  
  6823.   New Test.a Test.p Test.c
  6824.  
  6825.   Creates three windows called Test.a, Test.p, and Test.c.
  6826.  
  6827.  
  6828.                              See also 
  6829.  
  6830.   Open command.
  6831.  
  6832. æKY Newer
  6833. æC             Newer -- compare modification dates of files
  6834.  
  6835. Newer [-c] [-e] [-q] file… target > newer
  6836.  -c               # compare creation dates
  6837.  -e               # report names that have same (equal) mod date as target
  6838.  -q               # don't quote file names with special characters
  6839.  
  6840. Status codes returned:
  6841.   0    No error.
  6842.   1    Syntax error.
  6843.   2    File not found.
  6844.  
  6845.                            Description
  6846.  
  6847.   Compares the modification dates of name and target. Files that have
  6848.   a more recent modification date than target have their names written
  6849.   to standard output. If the target is a nonexistent file or directory,
  6850.   all names that exist are considered newer than the target.
  6851.  
  6852.  
  6853.                              Examples
  6854.  
  6855.   Newer main.c main.c.bak
  6856.  
  6857.   Writes out main.c if its modification date is more recent than its
  6858.   backup.
  6859.  
  6860.   Newer HD:Source:≈.c HD:TimeStamp
  6861.  
  6862.   Writes to the screen all the source files in the Source directory
  6863.   that have been modified since the modification date of TimeStamp.
  6864.  
  6865.   If `Newer main.c main.c.bak`
  6866.     Duplicate main.c main.c.bak
  6867.   End
  6868.  
  6869.   Makes a backup copy of main.c only if it has been modified since
  6870.   the last backup was made.
  6871.  
  6872.   If “`Newer File.c File.h File.c.o`”
  6873.     C File.c -o file.c.o
  6874.   End
  6875.  
  6876.   Rebuilds the source file file.c if either file.c or file.h has been
  6877.   modified since file.c.o was last built.
  6878.  
  6879. æKY NewFolder
  6880. æC                   NewFolder -- create a new folder
  6881.  
  6882. NewFolder name…
  6883.  
  6884. Status codes returned:
  6885.   0    Folders were created for each name listed.
  6886.   1    Syntax error.
  6887.   2    An error occurred.
  6888.   3    Attempt to use NewFolder on a non-HFS volume.
  6889.  
  6890.                            Description
  6891.  
  6892.   Creates new directories with the names specified. Any parent directories
  6893.   included in the name specification must already exist.
  6894.  
  6895.     • Note: This command can be used only on hierarchical file system
  6896.     (HFS) disks.
  6897.  
  6898.  
  6899.                              Examples
  6900.  
  6901.   NewFolder Memos
  6902.  
  6903.   Creates Memos as a subdirectory of the current directory.
  6904.  
  6905.   NewFolder Parent :Parent:Kid
  6906.  
  6907.   Creates Parent as a subdirectory of the current directory, and Kid
  6908.   as a subdirectory of Parent.
  6909.  
  6910. æKY NewProject
  6911. æC                  NewProject -- create a new project
  6912.  
  6913. NewProject -w | -close | ([-u user] [-cs comment | -cf file] project)
  6914.  -cf file                # the comment is contained in file.
  6915.  -close                  # close the New Project window
  6916.  -cs comment             # a short description of the project
  6917.  -w                      # open the New Project window
  6918.  -u user                 # name of current user
  6919.  
  6920. Status codes returned:
  6921.   0    No errors.
  6922.   1    Syntax error.
  6923.   2    Error in processing.
  6924.   3    System error.
  6925.  
  6926.                            Description
  6927.  
  6928.   NewProject creates a project under control of Projector. A project
  6929.   directory is created to store the files, subprojects, and other information
  6930.   related to the project. The name of the directory is the name of
  6931.   the project.
  6932.  
  6933.   If project is a project pathname (such as MPW∫Tools∫Enterprise),
  6934.   Projector creates Enterprise as a subproject of the existing MPW∫Tools
  6935.   project. In this case MPW∫Tools must be a mounted project (see the
  6936.   MountProject command).
  6937.  
  6938.   If project is a leafname (such as Enterprise), project directory
  6939.   Enterprise is created in the current directory.
  6940.  
  6941.   Finally, if project is a partial or full HFS pathname (such as :Work:Enterprise
  6942.   or FS:Projects:Enterprise), the project Enterprise is created in
  6943.   the HFS location specified.
  6944.  
  6945.   Add a MountProject command to the UserStartup file, a script, or
  6946.   AddMenu to easily mount the new project.
  6947.  
  6948.   The checkout directory is initially set to the current directory
  6949.   (:). To change the checkout directory, refer to the CheckOutDir command.
  6950.  
  6951.   To add files to the new project, use the CheckIn command (with the
  6952.   -new option) or the Check In window.
  6953.  
  6954.   See Chapter 7 of the MPW manual for complete definitions of the terms and
  6955.   symbols used in Projector commands.
  6956.  
  6957.  
  6958.                              Examples
  6959.  
  6960.   The following command creates a project Enterprise in the current
  6961.   directory. No comment is saved with the project, but you can add
  6962.   one later by selecting the project in the Check Out window's /Info
  6963.   view.
  6964.  
  6965.   NewProject Enterprise
  6966.  
  6967.   The next example creates a project Zoom in the FS:work:Zoom. The
  6968.   -cf option indicates that the comment for the new project is contained
  6969.   in the file Info.
  6970.  
  6971.   NewProject FS:work:Zoom -cf Info
  6972.  
  6973.   Finally, given that the project Enterprise∫Utilities exists and has
  6974.   been mounted using the MountProject command, the next command creates
  6975.   a Zoom project in the Enterprise∫Utilities project. In this case
  6976.   you don’t need to add a MountProject command to UserStartup, but
  6977.   you may want to add a CheckOutDir command to set the checkout directory.
  6978.  
  6979.   NewProject Enterprise∫Utilities∫Zoom -cs ∂
  6980.   “Upgrade Zoom utility”
  6981.  
  6982.  
  6983.                              See also 
  6984.  
  6985.   CheckOutDir, MountProject, Project.
  6986.  
  6987. æKY Open
  6988. æC                  Open -- open file(s) in window(s)
  6989.  
  6990. Open [-n | -r] [-t] [name…]
  6991.  -n                      # open new file (default name Untitled)
  6992.  -r                      # open file for read-only use
  6993.  -t                      # open file as the target window
  6994.  
  6995. Status codes returned:
  6996.   0    No errors.
  6997.   1    Error in parameters.
  6998.   2    Unable to complete operation; specified file not found.
  6999.   3    System error.
  7000.  
  7001.                            Description
  7002.  
  7003.   Opens a file as the active (frontmost) window. If name is not specifed,
  7004.   StdFile’s GetFile routine is called, allowing you to use a dialog
  7005.   box to choose a file. If name is already open as a window, that window
  7006.   becomes the active (frontmost) window.
  7007.  
  7008.  
  7009.                              Examples
  7010.  
  7011.   Open
  7012.  
  7013.   Displays StdFile from which to choose a file to open.
  7014.  
  7015.   Open -r -t Test.a
  7016.  
  7017.   Opens the file Test.a as the target window, read-only.
  7018.  
  7019.   Open ≈.a
  7020.  
  7021.   Opens all the files that end with “.a”.
  7022.  
  7023.  
  7024.                              See also 
  7025.  
  7026.   Target, New, and Close commands.
  7027.  
  7028. æKY OrphanFiles
  7029. æC  OrphanFiles -- remove Projector information from a list of files
  7030.  
  7031. OrphanFiles file…
  7032.  
  7033. Status codes returned:
  7034.   0    No errors.
  7035.   1    Syntax error.
  7036.   2    Error in processing.
  7037.  
  7038.                            Description
  7039.  
  7040.   Remove the 'CKID' resource from file(s). This removes the identification
  7041.   information from the file that Projector uses to uniquely identify it.
  7042.  
  7043.     • Warning Once the projector information is removed from a file,
  7044.     you cannot check the file back into the Project as a checked-out
  7045.     file.
  7046.  
  7047.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  7048.   symbols used in Projector commands.
  7049.  
  7050.  
  7051.                              Examples
  7052.  
  7053.   Suppose file.c and interactive.c belong to a project that has been
  7054.   deleted. We can remove the Projector information from them (so that
  7055.   they can be used for other purposes) with the command
  7056.  
  7057.   OrphanFiles file.c interactive.c
  7058.  
  7059.  
  7060.                              See also 
  7061.  
  7062.   TransferCkid.
  7063.  
  7064. æKY Parameters
  7065. æC                    Parameters -- write parameters
  7066.  
  7067. Parameters [parameter…]  > parameters
  7068.  
  7069. Status codes returned:   
  7070.   0    no errors is always returned.
  7071.  
  7072.                            Description
  7073.  
  7074.   The Parameters command writes its parameters, including its name,
  7075.   to standard output. The parameters are written one per line, and
  7076.   each is preceded by its parameter number (in braces) and a blank.
  7077.   This command is useful for checking the results of variable substitution,
  7078.   command substitution, quoting, blank interpretation, and filename
  7079.   generation.
  7080.  
  7081.  
  7082.                              Examples
  7083.  
  7084.   Parameters One Two “and Three”
  7085.  
  7086.   Writes the following four lines to standard output:
  7087.  
  7088.   {0} Parameters
  7089.   {1} One
  7090.   {2} Two
  7091.   {3} and Three
  7092.  
  7093.   Recall that “…” and '…' quotation marks are removed before parameters
  7094.   are passed to commands.
  7095.  
  7096.  
  7097.                              See also 
  7098.  
  7099.   Echo and Quote commands.
  7100.  
  7101.   “Parameters to Scripts” in Chapter 5.
  7102.  
  7103. æKY Pascal
  7104. æC                      Pascal -- Pascal compiler
  7105.  
  7106. Pascal [option…] [file…]  < file ≥ progress
  7107.     -b                   # generate A5 references for procedure addresses
  7108.     -c                   # syntax check only, don't create object file
  7109.     -clean               # erase all symbol table resources
  7110.     -d name=(TRUE|FALSE) # set compile time variable name
  7111.     -e file              # write errors to file
  7112.     -forward             # allow only explicit forward and external object declarations
  7113.     -h                   # suppress error messages regarding unsafe handles
  7114.     -i directory,…       # search for includes in directory,…
  7115.     -k directory         # create symbol table resource files in directory
  7116.     -m                   # allow greater than 32K globals by using 32 bit
  7117.     -mbg ch8             # include v2.0 compatible MacsBug symbols
  7118.     -mbg full            # include full (untruncated) symbols for MacsBug
  7119.     -mbg off             # don't include symbols for MacsBug
  7120.     -mbg number          # include MacsBug symbols truncated to length 
  7121.                          # number
  7122.     -mc68020             # generate MC68020 code 
  7123.     -mc68881             # generate MC68881 code for floating point operations
  7124.      -model farCode|     # generate load-time relocatable 32-bit references for
  7125.          farData|far     #   code, data, or both
  7126.      -model nearCode|    # generate 16-bit references for code, data, or both 
  7127.          nearData|near   #   (the default)
  7128.     -n                   # generate separate global data modules for better allocation
  7129.     -noload              # don't use or create any symbol table resources
  7130.     -o objname           # generate code in file or directory objname
  7131.     -only name…          # only generate code for named modules
  7132.     -ov                  # generate code to test for overflow
  7133.     -opt off             # don't apply code optimizations
  7134.     -opt on | full       # choose level of code optimization (full is default);
  7135.                          #   can modify with [,nopeep] [,nostatic]
  7136.     -p                   # write progress information to diagnostics
  7137.     -r                   # don't generate range checking code
  7138.     -rebuild             # rebuild all symbol table resources
  7139.     -sym off             # don't generate SADE records
  7140.     -sym on | full       # generate SADE records; can modify with [,nolines] [,notypes] [,novars]
  7141.     -t                   # write compilation time to diagnostics
  7142.     -u                   # initialize all data to $7267 for debugging use
  7143.     -w                   # don't perform peephole optimization
  7144.     -y directory         # create temporary files in directory
  7145.  
  7146. Status codes returned:
  7147.   0    Successful completion.
  7148.   1    Error in parameters.
  7149.   2    Compilation halted.
  7150.  
  7151.                            Description
  7152.  
  7153.   Compiles the specified Pascal source files (programs or units). You
  7154.   can specify zero or more filenames. Each file is compiled separately—compiling
  7155.   file Name .p creates object file Name .p.o. By convention, Pascal
  7156.   source filenames end in a “.p” suffix.
  7157.  
  7158.   See the MPW 3.0 Pascal Reference for details of the language definition.
  7159.  
  7160.  
  7161.                              Examples
  7162.  
  7163.   Pascal Sample.p
  7164.  
  7165.   Compiles the Sample program provided in the PExamples folder.
  7166.  
  7167.   Pascal File1.p File2.p -r
  7168.  
  7169.   Compiles File1.p and File2.p, producing object files File1.p.o and
  7170.   File2.p.o but performing no range checking.
  7171.  
  7172.     • Note: Listing files are not produced directly by the compiler.
  7173.     Refer to the PasMat and PasRef tools.
  7174.  
  7175.   Availability The MPW Pascal compiler is available as a separate Apple
  7176.   product.
  7177.  
  7178.  
  7179.                              See also 
  7180.  
  7181.   PasMat and PasRef commands.
  7182.  
  7183.   MPW 3.0 Pascal Reference.
  7184.  
  7185. æKY PascalIIGS
  7186. æC               PascalIIGS -- the MPW IIGS Pascal Compiler
  7187. PascalIIGS [option…] [file…] ≥ progress
  7188.  -c                   # syntax check only, don't create object file
  7189.  -d name=(TRUE|FALSE) # set compile time variable name
  7190.  -e file              # write errors to file
  7191.  -h                   # suppress error messages regarding unsafe handles
  7192.  -i directory,…       # search for includes in directory,…
  7193.  -o objname           # generate code in file or directory objname
  7194.  -p                   # write progress information to diagnostics
  7195.  -r                   # don't generate range checking code
  7196.  -t                   # write compilation time to diagnostics
  7197.  -u                   # initialize all data to $7267 for debugging use
  7198.  -y directory         # create temporary files in directory
  7199. æKY PasMat
  7200. æC                  PasMat -- Pasca programs formatter
  7201.  
  7202. PasMat [option…] [input [output]]  < input > output ≥ progress
  7203.  -a                      # set a-  disable CASE label bunching
  7204.  -b                      # set b+  enable IF bunching
  7205.  -body                   # set body+ to disable indenting procedure bodies
  7206.  -c                      # set c+  suppress Return before BEGIN
  7207.  -d                      # set d+  use {…} comment delimiters
  7208.  -e                      # set e+  capitalize identifiers
  7209.  -entab                  # replace multiple blanks with tabs
  7210.  -f                      # set f-  disable formatting
  7211.  -g                      # set g+  group assignment and call statements
  7212.  -h                      # set h-  disable FOR, WHILE, WITH bunching
  7213.  -i directory,…          # search for includes in directory,…
  7214.  -in                     # set in+ process includes
  7215.  -k                      # set k+  indent statements between BEGIN and END
  7216.  -l                      # set l+  literally copy reserved words, identifiers
  7217.  -list file              # write listings to file
  7218.  -n                      # set n+  group formal parameters
  7219.  -o width                # set output line width (default 80)
  7220.  -p                      # write progress information to diagnostics
  7221.  -pattern -old-new-      # modify include names, changing old to new
  7222.  -q                      # set q+  no special ELSE IF formatting
  7223.  -r                      # set r+  upper case reserved words
  7224.  -rec                    # set rec+ to indent field lists under defined id
  7225.  -s file                 # substitute identifiers based on pairs in file
  7226.  -t tab                  # set output tab setting (default 2)
  7227.  -u                      # rename identifiers to match first occurence
  7228.  -v                      # set v+  put THEN on separate line
  7229.  -w                      # set w+  upper case identifiers
  7230.  -x                      # set x+  suppress space around operators
  7231.  -y                      # set y+  suppress space around :=
  7232.  -z                      # set z+  suppress space after commas
  7233.  -:                      # set :+  align colons in VAR declarations
  7234.  -@                      # set @+  multiple CASE tags on separate lines
  7235.  -∂#                     # set #+  smart grouping of assignments and calls
  7236.  -_                      # set _+  delete _ from identifiers
  7237.  
  7238. Status codes returned:
  7239.   0    Normal termination.
  7240.   1    Parameter or option error.
  7241.  
  7242.                            Description
  7243.  
  7244.   Reformats Pascal source code into a standard format, suitable for
  7245.   printouts or compilation. PasMat accepts full programs, external
  7246.   procedures, blocks, and groups of statements.
  7247.  
  7248.     • Note: A syntactically incorrect program causes PasMat to abort.
  7249.     If this happens, the generated output will contain the formatted
  7250.     source up to the point of the error.
  7251.  
  7252.   PasMat options let you do the following:
  7253.  
  7254.     • Convert a program to uniform case conventions.
  7255.  
  7256.     • Indent a program to show its logical structure, and adjust
  7257.     lines to fit into a specified line length.
  7258.  
  7259.     • Change the comment delimiters ( * * ) to { } .
  7260.  
  7261.     • Remove the underscore character ( _ ) from identifiers, rename
  7262.     identifiers, or change their case.
  7263.  
  7264.     • Format include files named in MPW Pascal include directives.
  7265.  
  7266.   PasMat specifications can be made through PasMat options or through
  7267.   special formatter directives, which resemble Pascal compiler directives,
  7268.   and are inserted into the source file as Pascal comments. PasMat’s
  7269.   default formatting is straightforward and does not require you to
  7270.   use any options. The best way to find out how PasMat formats something
  7271.   is to try out a small example.
  7272.  
  7273.   See Appendix K of the MPW 3.0 Pascal Reference for details of PasMat
  7274.   directives and their functions. The first dialog box of the Pascal
  7275.   Commando dialog is reproduced here for your convenience.
  7276.  
  7277.  
  7278.                              Examples
  7279.  
  7280.   Pasmat -n -u -r -d -pattern “==formatted/=” Sample.p ∂
  7281.   “formatted/Sample.p”
  7282.  
  7283.   Formats the file Sample.p with the -n, -u, -r, and -d options and
  7284.   writes the output to the file “formatted/Sample.p”. Include files
  7285.   are processed
  7286.  
  7287.   ( -pattern ), and each Pascal compiler $I include file causes additional
  7288.   output files to be generated. Each of these files is created with
  7289.   the name “formatted/ filename ”, where filename is the filename specified
  7290.   in the corresponding include. (The -pattern parameter contains a
  7291.   null pattern (==) with “formatted/” as a replacement string—a null
  7292.   pattern always matches the start of a string.)
  7293.  
  7294.   Care must be taken when a command line contains quotes, slashes,
  7295.   or other special characters that are processed by the Shell itself.
  7296.   In this example, we used the slash character, so the strings containing
  7297.   it had to be quoted.
  7298.  
  7299.   Limitations PasMat has these limitations:
  7300.  
  7301.     • The maximum length of an input line is 255 characters.
  7302.  
  7303.     • The maximum output line length is 150 characters.
  7304.  
  7305.     • The input files and output files must be different.
  7306.  
  7307.     • Only syntactically correct programs, units, blocks, procedures,
  7308.     and statements are formatted. This limitation must be taken into
  7309.     consideration when separate MPW 3.0 include files and conditional
  7310.     compiler directives are to be formatted.
  7311.  
  7312.     • The Pascal include directive should be the last thing on the
  7313.     input line if include files are to be processed. Include files
  7314.     are processed to a maximum nesting depth of five. All include
  7315.     files not processed are summarized at the end of formatting.
  7316.     (This assumes, of course, that the in directive/option is in
  7317.     effect.)
  7318.  
  7319.     • The identifiers CYCLE and LEAVE are treated as reserved Pascal
  7320.     keywords by PasMat. They are treated as two loop control statements
  7321.     by Pascal unless explicitly declared.
  7322.  
  7323.     • While Pasmat supports Pascal’s $$Shell facility in include
  7324.     files, the processing of MPW’s {PInterfaces} files is not fully
  7325.     supported because these files conditionally include files (remember,
  7326.     conditionals are not processed). For this reason, do not use
  7327.     the -in or -e option to process files that include MPW {PInterfaces}
  7328.     files.
  7329.  
  7330.   Availability PasMat is available as part of a separate Apple product,
  7331.   MPW 3.0 Pascal .
  7332.  
  7333.  
  7334.                              See also 
  7335.  
  7336.   Pascal and PasRef commands.
  7337.  
  7338.   Appendix K of the MPW 3.0 Pascal Reference.
  7339.  
  7340. æKY PasRef
  7341. æC                  PasRef -- Pascal cross-referencer
  7342.  
  7343. PasRef [option…] [file…]  < file > crossReference ≥ progress
  7344.  -a                      # process includes and units each time encountered
  7345.  -c                      # process includes and units only once
  7346.  -cond                   # process $SETC and $IFC, $ELSEC, $ENDC conditionals
  7347.  -d                      # process each file separately
  7348.  -d name=TRUE|FALSE      # set $SETC variable name to TRUE or FALSE
  7349.  -i directory,…          # search for includes in directory,…
  7350.  -l                      # write identifiers in lower case
  7351.  -mc68020                # source contains {$IFC OPTION(MC68020)} directives
  7352.  -mc68881                # source contains {$IFC OPTION(MC68881)} directives
  7353.  -n                      # don't process USES or includes
  7354.  -ni | -noi[ncludes]     # don't process include files
  7355.  -nl | -nol[istings]     # don't list the input
  7356.  -nolex                  # don't write lexical information
  7357.  -nt | -not[otal]        # don't write total line count
  7358.  -nu | -nou[ses]         # don't process USES declarations   
  7359.  -o                      # source written using Object Pascal
  7360.  -p                      # write progress information to diagnostics
  7361.  -s                      # don't write include and USES filenames
  7362.  -t                      # cross reference by total line number
  7363.  -u                      # write identifiers in upper case
  7364.  -w width                # set output line width (default 110)
  7365.  -x width                # set maximum identifier width
  7366.  
  7367. Status codes returned:
  7368.   0    Normal termination.
  7369.   1    Parameter or option error.
  7370.  
  7371.                            Description
  7372.  
  7373.   Reads Pascal source files and writes a listing of the source followed
  7374.   by a cross-reference listing of all identifiers. Each identifier
  7375.   is listed in alphabetical order, followed by the number of the line
  7376.   on which it appears. Line numbers can refer to the entire source
  7377.   file, or can be relative to individual include files and units. Each
  7378.   reference indicates whether the identifier is defined, assigned,
  7379.   or simply named (for example, used in an expression).
  7380.  
  7381.   See the MPW 3.0 Pascal Reference for more information about the Pascal
  7382.   language. The first dialog box of PasRef’s Commando dialog is reproduced
  7383.   here for your convenience.
  7384.  
  7385.   Identifiers may be up to 63 characters long and are displayed in
  7386.   their entirety unless overridden with the -x directive. Identifiers
  7387.   can remain as they appear in the input, or they can be converted
  7388.   to all lowercase (-l ) or all uppercase (-u).
  7389.  
  7390.   For include files, line numbers are relative to the start of the
  7391.   include file; an additional key number indicates which include file
  7392.   is referred to. A list of each include file processed and its associated
  7393.   key number is displayed prior to the cross-reference listing.
  7394.  
  7395.   USES declarations can also be processed by PasRef (their associated
  7396.   $U filename compiler directives are processed as in the Pascal compiler).
  7397.   These declarations are treated exactly like includes, and, as with
  7398.   the compiler, only the outermost USES declaration is processed (that
  7399.   is, a used unit’s USES declaration is not processed).
  7400.  
  7401.   As an alternative to processing USES declarations, PasRef accepts
  7402.   multiple source files. Thus you cross-reference a set of main programs
  7403.   together with the units they use. All the sources are treated like
  7404.   include files for display purposes. In addition, PasRef checks to
  7405.   see whether it has already processed a file (for example, if it appeared
  7406.   twice on the input list, or if one of the files already used or included
  7407.   it). The file is skipped it has already been processed.
  7408.  
  7409.  
  7410.                              Examples
  7411.  
  7412.   PasRef -nu -w 80 Memory.p > Memory.p.Xref
  7413.  
  7414.   Cross-references the sample desk accessory Memory.p and writes the
  7415.   output to the file Memory.p.Xref. No USES declarations are processed
  7416.   (-nu). The following source and cross-reference listings are generated:
  7417.  
  7418.   1 1 1 -- {
  7419.   2 1 2 -- File Memory.p
  7420.   3 1 3 --
  7421.   4 1 4 -- Copyright Apple Computer, Inc. 1985-1987
  7422.   5 1 5 -- All rights reserved.
  7423.   6 1 6 -- }
  7424.   7 1 7 --
  7425.   8 1 8 -- {$D+} { MacsBug symbols on }
  7426.   9 1 9 -- {$R-} { No range checking }
  7427.   10 1 10 --
  7428.   11 1 11 -- UNIT Memory;
  7429.   12 1 12 --
  7430.   13 1 13 -- INTERFACE
  7431.   14 1 14 --
  7432.   15 1 15 -- USES
  7433.   16 1 16 -- MemTypes, QuickDraw, OSIntf, ToolIntf, PackIntf;
  7434.   17 1 17 --
  7435.   18 1 18 --
  7436.   19 1 19 -- FUNCTION DRVROpen (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7437.   20 1 20 -- FUNCTION DRVRControl (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7438.   21 1 21 -- FUNCTION DRVRStatus (ctlPB: ParmBlkPtr; dCtl:.DCtlPtr):OSErr;
  7439.   22 1 22 -- FUNCTION DRVRPrime (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7440.   23 1 23 -- FUNCTION DRVRClose (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7441.   24 1 24 --
  7442.   25 1 25 --
  7443.   26 1 26 -- IMPLEMENTATION
  7444.   etc.
  7445.  
  7446.   63 1 63 --A FUNCTION DRVRClose (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7447.   64 1 64 0-A BEGIN
  7448.   65 1 65 -- IF dCtl^.dCtlwindow <> NIL THEN
  7449.   66 1 66 1- BEGIN
  7450.   67 1 67 -- DisposeWindow (WindowPtr(dCtl^.dCtlWindow));
  7451.   68 1 68 -- dCtl^.dCtlWindow := NIL;
  7452.   69 1 69 -1 END;
  7453.   70 1 70 -- DRVRClose := NOErr;
  7454.   71 1 71 -0A END;
  7455.   etc.
  7456.  
  7457.   178 1 178 --
  7458.   179 1 179 -- END. {of memory UNIT}
  7459.   180 1 180 --
  7460.  
  7461.   Each line of the source listing is preceded by five columns of information:
  7462.  
  7463.   1. The total line count.
  7464.  
  7465.   2. The include key assigned by PasRef for an include or USES file.
  7466.   (See below.)
  7467.  
  7468.   3. The line number within the include or main file.
  7469.  
  7470.   4. Two indicators (left and right) that reflect the static block
  7471.   nesting level. The left indicator is incremented (mod 10) and displayed
  7472.   whenever a BEGIN, REPEAT, or CASE is encountered. On termination
  7473.   of these structures with an END or UNTIL, the right indicator is
  7474.   displayed, then decremented. It is thus easy to match BEGIN, REPEAT,
  7475.   and CASE statements with their matching terminations.
  7476.  
  7477.   5. A letter that reflects the static level of procedures. The character
  7478.   is updated for each procedure nest level (“A” for level 1, “B” for
  7479.   level 2, and so on), and displayed on the line containing the heading,
  7480.   and on the BEGIN and END associated with the procedure body. Using
  7481.   this column you can easily find the procedure body for a procedure
  7482.   heading when there are nested procedures declared between the heading
  7483.   and its body.
  7484.  
  7485.   The cross-reference listing follows:
  7486.  
  7487.   1. Memory.p
  7488.  
  7489.   -A-
  7490.  
  7491.   accEvent 144 ( 1)
  7492.   accRun 158 ( 1)
  7493.   ApplicZone 121 ( 1)
  7494.   Away 33* ( 1) 146 ( 1)
  7495.  
  7496.   -B-
  7497.  
  7498.   BeginUpdate 151 ( 1)
  7499.   BNOT 39 ( 1)
  7500.   Bold ( 1) 117 ( 1)
  7501.   Boolean 31* ( 1)
  7502.   BOR 39 ( 1)
  7503.   BSL 39 ( 1)
  7504.  
  7505.   -C-
  7506.  
  7507.   csCode 143 ( 1)
  7508.   CSParam 146 ( 1)
  7509.   ctlPB 19* ( 1) 20*( 1) 21*( 1) 22*( 1)..23*( 1) 43*( 1)
  7510.         63* ( 1) 74*( 1) 143 ( 1) 146 ( 1) 168*( 1) 173*( 1)
  7511.  
  7512.   -D-
  7513.  
  7514.   dCtl 19* ( 1) 20*( 1) 21*( 1) 22*( 1) 23*( 1) 37*( 1)
  7515.        39  ( 1) 43*( 1) 50 ( 1) 53 ( 1) 54 ( 1) 55 ( 1)
  7516.        63* ( 1) 65 ( 1) 67 ( 1) 68 ( 1) 74*( 1) 115 ( 1)
  7517.        142 ( 1) 168*( 1) 173*( 1)
  7518.   DCtlPtr 19 ( 1) 20 ( 1) 21 ( 1) 22 ( 1) 23 ( 1) 37 ( 1)
  7519.           43 ( 1) 63 ( 1) 74 ( 1) 168 ( 1) 173 ( 1)
  7520.   dCtlRefNum 39 ( 1) 54 ( 1)
  7521.   dCtlWindow 50 ( 1) 55=( 1) 67 ( 1) 68=( 1) 142 ( 1)
  7522.   etc.
  7523.  
  7524.   -V-
  7525.  
  7526.   VolName 79* ( 1) 100 ( 1) 135 ( 1)
  7527.  
  7528.   -W-
  7529.  
  7530.   what 149 ( 1)
  7531.   WindowKind 54= ( 1)
  7532.   windowpeek 54 ( 1)
  7533.   WindowPtr 48 ( 1) 67 ( 1) 151 ( 1) 153 ( 1)
  7534.   wRect 47* ( 1)
  7535.  
  7536.   *** End PasRef: 105 id's 249 references
  7537.  
  7538.   The numbers in parentheses following the line numbers are the include
  7539.   keys of the associated include files (shown in column 2 of the source
  7540.   listing). The include filenames are shown following the source listing.
  7541.   You can thus see what line number was in which include file. An asterisk
  7542.   (*) following a line number indicates a definition of the variable.
  7543.   An equal sign (=) indicates an assignment. A line number with nothing
  7544.   following it indicates a reference to the identifier.
  7545.  
  7546.   Limitations PasRef has these limitations:
  7547.  
  7548.     • PasRef does not process conditional compilation directives!
  7549.     Thus, given the “right” combination of $IFCs and $ELSECs, PasRef’s
  7550.     lexical (nesting) information can be thrown off. If this happens,
  7551.     or if you don’t want the lexical information, you can specify
  7552.     the -nolex option.
  7553.  
  7554.     • PasRef stores all its information on the Pascal heap. Up to
  7555.     5000 identifiers can be handled, but more identifiers will mean
  7556.     less cross-reference space. A message appears if PasRef runs
  7557.     out of heap space.
  7558.  
  7559.     • Note: Although PasRef never misses a reference, it can infrequently
  7560.     be fooled into thinking that a variable is defined when it actually
  7561.     isn’t. One case where this happens is in record structure variants.
  7562.     The record variant’s case tag is always flagged as a definition
  7563.     (even when there is no tag type) and the variant’s case label
  7564.     constants (if they are identifiers) are also sometimes incorrectly
  7565.     flagged, depending on the context. (This occurs only in the declaration
  7566.     parts of the program.)
  7567.  
  7568.     • While PasRef supports Pascal’s $$Shell facility in include
  7569.     files and USES declarations, the processing of MPW’s {PInterfaces}
  7570.     files is not fully supported because these files conditionally
  7571.     include files (remember, conditionals are not processed). For
  7572.     this reason, always use the -nu option to suppress processing
  7573.     of USES declarations.
  7574.  
  7575.     • The identifiers CYCLE and LEAVE are treated as reserved Pascal
  7576.     keywords by PasRef. These are treated as two loop control statements
  7577.     by Pascal unless explicitly declared.
  7578.  
  7579.   Availability PasRef is available as part of a separate Apple product,
  7580.   MPW 3.0 Pascal.
  7581.  
  7582.  
  7583.                              See also 
  7584.  
  7585.   Pascal command.
  7586.  
  7587.   MPW 3.0 Pascal Reference.
  7588.  
  7589. æKY Paste
  7590. æC          Paste -- replace selection with Clipboard contents
  7591.  
  7592. Paste [-c count] selection [window]
  7593.  -c count                # repeat the Paste count times
  7594.  
  7595. Status codes returned:
  7596.   0    At least one instance of the selection was found.
  7597.   1    Syntax error.
  7598.   2    Any other error.
  7599.  
  7600.                            Description
  7601.  
  7602.   Finds selection in the specified window and replaces its contents
  7603.   with the contents of the Clipboard. If no window is specified, the
  7604.   command operates on the target window (the second window from the
  7605.   front). It’s an error to specify a window that doesn’t exist.
  7606.  
  7607.   For a definition of selection, see “Selections” in Chapter 6 of the MPW 
  7608.   manual; a summary of the selection syntax is contained in Appendix B.
  7609.  
  7610.  
  7611.                              Examples
  7612.  
  7613.   Paste §
  7614.  
  7615.   Replaces the current selection with the contents of the Clipboard.
  7616.   This command is like the Paste item in the Edit menu, except that
  7617.   the action occurs in the target window.
  7618.  
  7619.   Paste /BEGIN/:/END/
  7620.  
  7621.   Selects everything from the next BEGIN to the following END and replaces
  7622.   the selection with the contents of the Clipboard.
  7623.  
  7624.  
  7625.                              See also 
  7626.  
  7627.   Copy, Cut, and Replace commands.
  7628.  
  7629.   “Edit Menu” in Chapter 3.
  7630.  
  7631.   “Selections” in Chapter 6.
  7632.  
  7633. æKY PerformReport
  7634. æC            PerformReport -- generate a performance report
  7635.  
  7636. PerformReport [option…]  > reportFile ≥ progress
  7637.  -a                      # list all procedures, in segment order
  7638.                          # (default: produce only partial list, sorted by %)
  7639.  -l linkDataFile         # read link map file (concatenated with ROM.list)
  7640.  -m measurementsFile     # read performance measurements file
  7641.                          # (default: "Perform.Out")
  7642.  -n NN                   # show the top NN procedures (default: 50)
  7643.  -p                      # write progress information to diagnostics
  7644.  
  7645. Status codes returned:
  7646.   0    No errors.
  7647.   1    Warning issued.
  7648.   2    Error encountered.
  7649.   3    Heap error;usually insufficient memory.
  7650.  
  7651.                            Description
  7652.  
  7653.   PerformReport reads a link map file and a performance data file and
  7654.   produces a report that relates the performance data to procedure
  7655.   names. The input files are both text files and are distinguished
  7656.   as separate options. For a full discussion of MPW’s performance measurement
  7657.   tools, see Chapter 14 of the MPW manual.
  7658.  
  7659.  
  7660.                              Examples
  7661.  
  7662.   Catenate “{MPW}”ROM.Maps:MacIIROM.map >> myMapFileName
  7663.  
  7664.   PerformReport -l myMapFileName > myReport
  7665.  
  7666.   Adds the ROM map file to the end of the link map file, myMapFileName.
  7667.   Reads the files myMapFileName and Perform.out and writes the output
  7668.   to myReport.
  7669.  
  7670.  
  7671.                              See also 
  7672.  
  7673.   Chapter 14, “Performance-Measurement Tools.”
  7674.  
  7675.   MPW 3.0 Pascal Reference.
  7676.  
  7677.   MPW 3.0 C Reference .
  7678.  
  7679. æKY Position
  7680. æC              Position -- display current line position
  7681.  
  7682. Position [-l | -c] [window…]
  7683.  -l                      # only list the line number
  7684.  -c                      # only list the character offsets
  7685.  
  7686. Status codes returned:
  7687.   0    No errors.
  7688.   1    Syntax error.
  7689.   2    Any other error.
  7690.  
  7691.                            Description
  7692.  
  7693.   Position displays the position of the selection in each of the windows
  7694.   specified. If no window is specified, the position of the selection
  7695.   in the Target window is given. By default, the position is displayed
  7696.   as both the line number of the start of the selection and the character
  7697.   positions of the start and end of the selection. The -c option can
  7698.   be used to display only the character positions of the selection.
  7699.   Similarly, the -l option can be used to display only the line number.
  7700.  
  7701.  
  7702.                              Examples
  7703.  
  7704.   Position {Target} file2
  7705.  
  7706.   Displays the position of the selection in both the Target and file2
  7707.   in the following form:
  7708.  
  7709.   578 23129,23140
  7710.  
  7711.   211 8440,8440
  7712.  
  7713.  
  7714.                              See also 
  7715.  
  7716.   Find command.
  7717.  
  7718. æKY Print
  7719. æC                      Print -- print text files
  7720.  
  7721. Print [option…] file…  < file ≥ progress
  7722.  -b                   # print a border around the text
  7723.  -b2                  # alternate form of border
  7724.  -bm n[.n]            # bottom margin in inches (default 0)
  7725.  -c[opies] n          # print n copies
  7726.  -ff string           # treat "string" at beginning of line as a formfeed
  7727.  -f[ont] name         # print using specified font
  7728.  -from n              # begin printing with page n
  7729.  -h                   # print headers (time, file, page)
  7730.  -hf[ont] name        # print headers using specified font
  7731.  -hs[ize] n           # print headers using specified font size
  7732.  -l[ines] n           # print n lines per page
  7733.  -lm n[.n]            # left margin in inches (default .2778)
  7734.  -ls n[.n]            # line spacing (2 means double-space)
  7735.  -md                  # use modification date of file for time in header
  7736.  -n                   # print line numbers to left of text
  7737.  -nw [-]n             # width of line numbers, - indicates zero padding
  7738.  -p                   # write progress information to diagnostics
  7739.  -page n              # number pages beginning with n
  7740.  -ps filename         # include PostScript file as background for each page
  7741.  -q quality           # print quality (HIGH, STANDARD, DRAFT)
  7742.  -r                   # print pages in reverse order
  7743.  -rm n[.n]            # right margin in inches (default 0)
  7744.  -s[ize] n            # print using specified font size
  7745.  -t[abs] n            # consider tabs to be n spaces
  7746.  -title title         # include title in page headers
  7747.  -tm n[.n]            # top margin in inches (default 0)
  7748.  -to n                # stop printing after page n
  7749.  
  7750. Status codes returned:
  7751.   0    Successful completion.
  7752.   1    Parameter or option error.
  7753.   2    Execution error.
  7754.  
  7755.                            Description
  7756.  
  7757.   Prints text files on the currently selected printer. (Printers are
  7758.   selected with the Chooser desk accessory.) One or more files may
  7759.   be printed.
  7760.  
  7761.     • Note: Print does not substitute fonts unless the “Font Substitution”
  7762.     box is checked in the “LaserWriter Page Setup” dialog. To print
  7763.     in a font other than that indicated in the resource fork of the
  7764.     file where the MPW editor stores font information, use the -font
  7765.     option.
  7766.  
  7767.     • Important Print requires the printer drivers available on version
  7768.     1.0 (or later) of the Printer Installation disk.
  7769.  
  7770.  
  7771.                              Examples
  7772.  
  7773.   Print -h -size 8 -ls 0.85 Startup UserStartup
  7774.  
  7775.   Prints the files Startup and UserStartup with page headers, using
  7776.   Monaco 8 and compressing the line spacing.
  7777.  
  7778.   Print -b -hf helvetica -hs 12 -r print.p
  7779.  
  7780.   Prints the “print.p” source file with borders, with headers in Helvetica
  7781.   12, and with pages in reverse order.
  7782.  
  7783.  
  7784.                              See also 
  7785.  
  7786.   Print menu item in “File Menu,” Chapter 3.
  7787.  
  7788. æKY ProcNames
  7789. æC        ProcNames -- display Pascal procedure and function names
  7790.  
  7791. ProcNames [option…] [file…]  < file ≥ progress
  7792.     -b                      # display line info for procedure body
  7793.     -c                      # process includes and units only once
  7794.     -cond                   # process $SETC and $IFC, $ELSEC, $ENDC conditionals
  7795.     -d                      # reset total line count to 1 on each new file
  7796.     -d name=TRUE|FALSE      # set $SETC variable name to TRUE or FALSE
  7797.     -e                      # suppress page eject between each procedure listing
  7798.     -f                      # PasMat format compatibility mode
  7799.     -i pathname,…           # search for includes or USES in directory,…
  7800.     -l n                    # process only to max nesting level n
  7801.     -m                      # generate MPW Mark commands for procedure and function declarations
  7802.     -mc68020                # source contains {$IFC OPTION(MC68020)} directives
  7803.     -mc68881                # source contains {$IFC OPTION(MC68881)} directives
  7804.     -n                      # suppress line number and level information
  7805.     -o                      # source file is an Object Pascal program
  7806.     -p                      # write progress information to diagnostics
  7807.     -u                      # process USES declarations
  7808.  
  7809.   Status codes returned:
  7810.      0    Normal termination.
  7811.      1    Parameter or option error.
  7812.  
  7813.                            Description
  7814.  
  7815.   ProcNames is a Pascal utility that accepts a Pascal program or unit
  7816.   as input and produces a listing of all its procedure and function
  7817.   names. The names are shown indented as a function of their nesting
  7818.   level. The nesting level and line-number information is also displayed.
  7819.  
  7820.   ProcNames can be used in conjunction with the Pascal “pretty-printer”
  7821.   PasMat when that utility is used to format separate include files.
  7822.   For that case, PasMat requires that the initial indenting level be
  7823.   specified. This level is exactly the information provided by ProcNames.
  7824.  
  7825.   The line-number information displayed by ProcNames exactly matches
  7826.   that produced by the Pascal cross-reference utility PasRef (with
  7827.   or without USES declarations being processed), so ProcNames can be
  7828.   used in conjunction with the listing produced by PasRef to show just
  7829.   the line numbers of every procedure or function header.
  7830.  
  7831.   Another possible use for the ProcNames output is to use the line-number
  7832.   and file information to find procedures and functions quickly with
  7833.   Shell editing commands.
  7834.  
  7835.  
  7836.                              Examples
  7837.  
  7838.   procnames Memory.p >names
  7839.  
  7840.   Lists all the procedures and functions for the Pascal program Memory.p
  7841.   and writes the output to the file “names”. The listing below is the
  7842.   output generated in the “names” file.
  7843.  
  7844.   Procedure/Function names for Memory.p
  7845.  
  7846.    11  11 0 Memory[Main] Memory.p
  7847.    37  37 1 RsrcID
  7848.    43  43 1 DRVROpen
  7849.    63  63 1 DRVRCloseaa
  7850.    74  74 1 DRVRControla
  7851.    76  76 2   DrawWindow
  7852.    83  83 3     PrintNum
  7853.    93  93 3     GetVolStuff
  7854.   108 108 3     PrtRsrcStr
  7855.   168 168 1 DRVRPrime
  7856.   173 173 1 DRVRStatus
  7857.  
  7858.   *** End ProcNames: 11 Procedures and Functions
  7859.  
  7860.   The first two columns on each line are line-number information. The
  7861.   third column is the level number. The first column shows the line
  7862.   number of a routine within the total source. The second column shows
  7863.   the line number within an include file (include files are always
  7864.   processed). As each include file changes, the name of the file from
  7865.   which input is being processed is shown along with the routine name
  7866.   on the first line after the change in source. Segment names (from
  7867.   Pascal compiler $S directives) are similarly processed. These are
  7868.   shown enclosed in square brackets (the blank segment name is shown
  7869.   as “[Main]”).
  7870.  
  7871.   Limitations Only syntactically correct programs are accepted by ProcNames.
  7872.   Conditional compilation compiler directives are not processed.
  7873.  
  7874.   Although ProcNames supports $$Shell facility in includes and USES,
  7875.   the processing of MPW’s {PInterfaces} files is not fully supported
  7876.   because these files conditionally include files. Therefore, do not
  7877.   use the -u option.
  7878.  
  7879. æKY Project
  7880. æC             Project -- set or write the current project
  7881.  
  7882. Project [-q | projectName]   > project
  7883.  -q                      # don't quote projects with special characters
  7884.  
  7885. Status codes returned:
  7886.   0    No errors.
  7887.   1    Syntax error.
  7888.   2    Error in processing.
  7889.  
  7890.                            Description
  7891.  
  7892.   Set the current project to projectname or list the current project
  7893.   if projectname is omitted. Projectname must be a mounted project.
  7894.   Refer to the MountProject command for information on how to mount
  7895.   projects.
  7896.  
  7897.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  7898.   symbols used in Projector commands.
  7899.  
  7900. æKY ProjectInfo
  7901. æC          ProjectInfo -- display information about a Project
  7902.  
  7903. ProjectInfo [-project project] [-comments] [-latest] [-f] [-r] [-s] [-only 
  7904.             | -m] [-af author | -a author] [-df dates | -d dates] 
  7905.             [-cf pattern | -c pattern] [-t pattern] [-n name] 
  7906.             [-newer | -update] [file…]
  7907.  -a author         # only list revisions created by author
  7908.  -af author        # only list files created by author
  7909.  -c pattern        # only list revisions whose comment contains pattern
  7910.  -cf pattern       # only list files whose comment contains pattern
  7911.  -comments         # list comments along with the rest of the information
  7912.  -d dates          # only list revisions whose create date is within dates
  7913.  -df dates         # only list files whose mod date is within dates
  7914.  -f                # list file information
  7915.  -log              # print project log
  7916.  -m                # only list files/revisions that are checked out
  7917.  -newer            # info on files that would be checked out using this option
  7918.  -only             # only list project information
  7919.  -project project  # name of project to get information on
  7920.  -r                # recursively list subprojects
  7921.  -latest           # only list info on the latest revision on the main trunk
  7922.  -s                # short listing, names and revision names only
  7923.  -t pattern        # only list revisions whose task contains pattern
  7924.  -n name           # only list revisions that have name
  7925.  -update           # info on files that would be checked out using this option
  7926.  
  7927.  Note: pattern is either a literal string or /regular expression/.
  7928.  
  7929.  Note: "dates" may take the following forms:
  7930.      date                # on date
  7931.      <date               # before but not including date
  7932.      ≤date               # before and including date
  7933.      >date               # after and not including date
  7934.      ≥date               # after and including date
  7935.      date-date           # between and including dates
  7936.      
  7937.  Note:  A date is mm/dd/yy [[hh:mm[:ss]] [AM|PM]]
  7938.  
  7939.  Note: "name" may take the following forms:
  7940.      name                # in name
  7941.      <name               # before name
  7942.      ≤name               # before and including name
  7943.      >name               # after name
  7944.      ≥name               # after and including name
  7945.  
  7946. Status codes returned:
  7947.   0    No errors.
  7948.   1    Syntax error.
  7949.   2    Error in processing.
  7950.   3    System error.
  7951.  
  7952.                            Description
  7953.  
  7954.   By default (with no options specified), ProjectInfo lists information
  7955.   about each revision in every revision tree (file) in the current
  7956.   project. This behavior can be changed using the various options.
  7957.   For example, using the -latest option will display only information
  7958.   about the latest revision on the main trunk of each revision tree.
  7959.   Using the -f option will display information about the revision tree,
  7960.   rather than the particular revisions within that tree. Various other
  7961.   options exist that filter the output such that only the information
  7962.   (typically revisions) that passes through the filter is listed.
  7963.  
  7964.   If object is a project pathname such as Enterprise∫Phaser∫file.c
  7965.   or Enterprise∫Phaser, Projector lists information about every revision
  7966.   of file.c in the Phaser project, or information about every revision
  7967.   tree in the project Enterprise∫Phaser, respectively.
  7968.  
  7969.   If object is a leafname such as file.c, Projector looks in the current
  7970.   project for a revision tree with that name. If found, information
  7971.   about every revision in that revision tree (file.c) is listed. If
  7972.   the file is not a member of the current project, Projector looks
  7973.   for the file in the current directory. If the file exists and is
  7974.   part of a project, then the current state of that file is listed.
  7975.   Projector can determine whether a file belongs to a project because
  7976.   that information is maintained in the resource fork of all checked-out
  7977.   files.
  7978.  
  7979.   Finally, if object is a valid partial or full HFS pathname of a file,
  7980.   and the file is part of a project, then the current state of that
  7981.   file is listed.
  7982.  
  7983.   To list the contents of a specific revision of a file, append a comma
  7984.   followed by the revision number to the filename specified. For example,
  7985.   revision 22 of file.c is specified as file.c,22.
  7986.  
  7987.   You can use the -af, -a, -df, -d, -n, -cf, -c, and -t options to
  7988.   filter (constrain) the information listed to specific authors, dates,
  7989.   names, specific comments, or tasks.
  7990.  
  7991.   Use the -log option to display a log of all changes to the project.
  7992.   These commands are logged: NameRevisions, DeleteRevisions, and DeleteNames.
  7993.  
  7994.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  7995.   symbols used in Projector commands.
  7996.  
  7997.  
  7998.                              Examples
  7999.  
  8000.   In the example below, the current project has three files. The -latest
  8001.   option is used so that only information about the latest revision
  8002.   on the main trunk is listed. The presence of the plus sign (+) indicates
  8003.   that Bob currently has revision 22 of file.c checked out for modification,
  8004.   and that Peter has revision 33 of hdr.c checked out for modification.
  8005.   The date field of these two files reflects the date and time they
  8006.   were checked out. Because no plus sign appears on the line for file.h,
  8007.   it can be checked out for modification. The latest revision of file.h
  8008.   is 17, and the author of the revision is Bob.
  8009.  
  8010.   ProjectInfo -latest
  8011.  
  8012.   Sample∫
  8013.   file.c,22+
  8014.     Owner: Bob
  8015.     Checked out: Fri, Apr 8, 1988, 3:45 PM
  8016.     Task: Fixing bug #223
  8017.  
  8018.   file.h,17
  8019.     Author: Bob
  8020.     Checked in: Mon, Apr 4, 1988, 10:10 AM
  8021.     Task:
  8022.  
  8023.   hdr.c,33+
  8024.     Owner: Peter
  8025.     Checked out: Tue, Apr 12, 1988, 5:58 PM
  8026.     Task: Fixing bug #333
  8027.  
  8028.   Using the -only option causes ProjectInfo to list only information
  8029.   about the project itself.
  8030.  
  8031.   ProjectInfo -only
  8032.  
  8033.   Sample∫
  8034.     Author: Bob
  8035.     Create date: Mon, Apr 4, 1988 8:20 AM
  8036.     Mod date: Thu, Apr 14, 1988, 6:00 PM
  8037.  
  8038.   Use the -f option to list filenames. Note that revision numbers are
  8039.   absent and that the file’s author and last-mod-date are listed. In
  8040.   the example below, file.c and hdr.c are currently checked out.
  8041.  
  8042.   ProjectInfo -f
  8043.  
  8044.   Sample∫
  8045.   file.c
  8046.     Author: Bob
  8047.     Create date: Mon, Apr 4, 1988, 10:00 AM
  8048.     Mod date: Tue, Apr 5, 1988, 2:15 PM
  8049.     Free: No
  8050.  
  8051.   file.h
  8052.     Author: Bob
  8053.     Create date: Mon, Apr 4, 1988, 10:00 AM
  8054.     Mod date: Mon, Apr 4, 1988, 10:00 AM
  8055.     Free: Yes
  8056.  
  8057.   hdr.c
  8058.     Author: Peter
  8059.     Create date: Mon, Apr 4, 1988, 3:30 PM
  8060.     Mod date: Mon, Apr 4, 1988, 6:00 PM
  8061.     Free: No
  8062.  
  8063.   Use the -f and -s options together to output the list of files in
  8064.   the project:
  8065.  
  8066.   ProjectInfo -f -s
  8067.  
  8068.   Sample∫
  8069.   file.c
  8070.   file.h
  8071.   hdr.c
  8072.  
  8073.   The following command will display the entire revision history of
  8074.   file.c. Note that the comment option has been included here as well.
  8075.  
  8076.   ProjectInfo -comments file.c
  8077.  
  8078.   file.c,2+
  8079.     Owner: Bob
  8080.     Checked out: Fri, Apr 8, 1988, 3:45 PM
  8081.     Task: Fixing bug #223
  8082.     Comment: COMMENT…
  8083.  
  8084.   file.c,2
  8085.     Author: Bob
  8086.     Checked in: Thu, Apr 7, 1988, 1:10 PM
  8087.     Task: Fixing bug #222
  8088.     Comment: COMMENT…
  8089.  
  8090.   file.c,1
  8091.     Author: Bob
  8092.     Checked in: Mon, Apr 4, 1988, 9:25 PM
  8093.     Task: Updating procedure comments
  8094.     Comment: COMMENT…
  8095.  
  8096.   Information about HFS files may be displayed by specifying a partial
  8097.   or full HFS pathname. This displays the information in the 'ckid'
  8098.   resource of the file.
  8099.  
  8100.   ProjectInfo :file.c
  8101.  
  8102.   :file.c,22*
  8103.     Owner: Bob
  8104.     Project: Sample∫
  8105.     Checked out: Fri, Apr 8, 1988, 3:45 PM
  8106.     Task: Fixing bug #223
  8107.  
  8108.   The asterisk (*) following the name indicates that the file is a
  8109.   modified read-only file.
  8110.  
  8111.   In the example below, only revisions created by Bob and created on
  8112.   or after April 4, 1988, are displayed.
  8113.  
  8114.   ProjectInfo -a Bob -d
  8115.  
  8116.   Sample∫
  8117.   file.c,22+
  8118.     Owner: Bob
  8119.     Checked out: Fri, Apr 8, 1988, 3:45 PM
  8120.     Task: Fixing bug #223
  8121.  
  8122.   file.c,22
  8123.     Author: Bob
  8124.     Checked in: Thu, Apr 7, 1988, 1:10 PM
  8125.     Task: Fixing bug #222
  8126.  
  8127.   file.c,21
  8128.     Author: Bob
  8129.     Checked in: Mon, Apr 4, 1988, 9:25 PM
  8130.     Task: Updating procedure comments
  8131.  
  8132.   file.h,17
  8133.     Author: Bob
  8134.     Checked in: Mon, Apr 4, 1988, 10:10 AM
  8135.     Task:
  8136.  
  8137.   In the example below, only revisions that have a task dealing with
  8138.   Bug #222 are listed.
  8139.  
  8140.   ProjectInfo -t /bug≈222/
  8141.  
  8142.   Sample∫
  8143.   file.c,22
  8144.     Author: Bob
  8145.     Checked in: Thu, Apr 7, 1988, 1:10 PM
  8146.     Task: Fixing bug #222
  8147.  
  8148.   hdr.c,31
  8149.     Author: Peter
  8150.     Checked in: Fri, Apr 1, 1988, 3:50 PM
  8151.     Task: Bug222 - Adding check procedure
  8152.  
  8153.   The final example demonstrates the -log option.
  8154.  
  8155.   ProjectInfo -log
  8156.  
  8157.   TheShell∫Projector
  8158.     7/5/88 4:07 PM
  8159.       Peter J. Potrebic
  8160.       DeleteNames Work
  8161.     7/2/88 1:37 PM
  8162.       Peter J. Potrebic
  8163.       NameRevisions Work bitmaps.a,2 ckid.c,3a2
  8164.  
  8165.   The log shows that Peter created a public name on July 2 and then
  8166.   deleted it on July 5.
  8167.  
  8168.  
  8169.                              See also 
  8170.  
  8171.   MountProject and UnmountProject.
  8172.  
  8173. æKY Quit
  8174. æC                          Quit -- quit MPW
  8175.  
  8176. Quit [-y | -n | -c]
  8177.  -y                  # save all modified windows (avoids dialog)
  8178.  -n                  # do not save any modified windows (avoids dialog)
  8179.  -c                  # cancel if a window needs to be saved (avoids dialog)
  8180.  
  8181. Status codes returned:
  8182.   1    Syntax error.
  8183.   2    Command aborted.
  8184.        Note: Quit cannot return a status of 0, because if there are no errors 
  8185.        the command never returns.
  8186.  
  8187.                            Description
  8188.  
  8189.   This command is equivalent to the menu command Quit. Quit executes
  8190.   the standard quit procedures, asking confirmation to save modified
  8191.   files, close all windows, and so on.
  8192.  
  8193.  
  8194.                              Examples
  8195.  
  8196.   Quit -y
  8197.  
  8198.   Quits MPW answering “Yes” to any dialogs such as those prompting
  8199.   to save files.
  8200.  
  8201.   Quit -c
  8202.  
  8203.   Quits MPW, unless any confirmation dialogs occur and dialog boxes
  8204.   are displayed.
  8205.  
  8206.  
  8207.                              See also 
  8208.  
  8209.   Shutdown command.
  8210.  
  8211. æKY Quote
  8212. æC             Quote -- echo parameters, quoting if needed
  8213.  
  8214. Quote [-n] [parameter…]   > parameters
  8215.  -n                      # don't write return following the parameters
  8216.  
  8217. Status codes returned:  
  8218.  0  no errors always returned.
  8219.  
  8220.                            Description
  8221.  
  8222.   Quote writes its parameters, separated by spaces and terminated by
  8223.   a return, to standard output. Parameters containing characters that
  8224.   have special meaning to the Shell’s command interpreter are quoted
  8225.   with single quotation marks. If no parameters are specified, only
  8226.   a return is written.
  8227.  
  8228.   Quote is identical to Echo except that Quote quotes parameters that
  8229.   contain special characters. Quote is especially useful when using
  8230.   Shell commands to write a script.
  8231.  
  8232.   The following special characters are quoted:
  8233.  
  8234.   Space Tab Return Null
  8235.  
  8236.   # ; & | ( ) ∂ ' " / \ { } ` ? ≈ [ ] + * « » ® < > ≥ …
  8237.  
  8238.  
  8239.                              Examples
  8240.  
  8241.   Echo ≈.a
  8242.  
  8243.   Quote ≈.a
  8244.  
  8245.   Sample.a Count.a My Program.a
  8246.  
  8247.   Sample.a Count.a 'My Program.a'
  8248.  
  8249.   Echo and Quote behave slightly differently for parameters that contain
  8250.   special characters. The first line above was produced by Echo; the
  8251.   second by Quote.
  8252.  
  8253.   Quote Notice what happens to single quotes: “--'--”
  8254.  
  8255.   Notice what happens to single quotes: '--'''--'
  8256.  
  8257.   Because single quotes can’t appear within single quotes, they are
  8258.   replaced with
  8259.  
  8260.   '' ' which closes the original single quote, adds a literal quote,
  8261.   and reopens the single quotes.
  8262.  
  8263.   For file In ≈.a
  8264.     Quote Print “{file}”
  8265.   End
  8266.   Print Sample.a
  8267.   Print Count.a
  8268.   Print 'My Program.a'
  8269.  
  8270.   The For loop shown above writes a Print command for each file that
  8271.   matches the pattern ≈.a. These commands can then be selected and
  8272.   executed. Notice the quotation marks in the last Print command.
  8273.  
  8274.  
  8275.                              See also 
  8276.  
  8277.   Echo and Parameters commands.
  8278.  
  8279. æKY Rename
  8280. æC               Rename -- rename files and directories
  8281.  
  8282. Rename [-y | -n | -c] oldName newName
  8283.  -y                      # overwrite existing file (avoids dialog)
  8284.  -n                      # don't overwrite existing file (avoids dialog)
  8285.  -c                      # cancel if conflict occurs (avoids dialog)
  8286.  
  8287. Status codes returned:
  8288.   0    Successful rename.
  8289.   1    Syntax error.
  8290.   2    Name does not exist.
  8291.   3    An error occurred.
  8292.   4    Cancel was selected or implied by the -c option.
  8293.  
  8294.                            Description
  8295.  
  8296.   The file, folder or disk specified by name is renamed newName. A
  8297.   dialog box requests a confirmation if the rename would overwrite
  8298.   an existing file or folder. The -y, -n, or -c options can be used
  8299.   to avoid this interaction.
  8300.  
  8301.     • Note: You can’t use the Rename command to change the directory
  8302.     a file is in. To do this, use the Move command.
  8303.  
  8304.     • Note also: Wildcard renames in the following form will not
  8305.     work:
  8306.  
  8307.   Rename ≈.text ≈.p
  8308.  
  8309.   This is because the Shell expands the filename patterns “≈.text”
  8310.   and “≈.p” before invoking the Rename command. In order to gain the
  8311.   desired effect, you would need to execute a command such as the one
  8312.   shown in the fifth example below.
  8313.  
  8314.  
  8315.                              Examples
  8316.  
  8317.   Rename File1 File2
  8318.  
  8319.   Changes the name of File1 to File2.
  8320.  
  8321.   Rename HD:Programs:Prog.c Prog.Backup.c
  8322.  
  8323.   Changes the name of Prog.c in the directory HD:Programs to Prog.Backup.c
  8324.   in the same directory.
  8325.  
  8326.   Rename Untitled: Backup:
  8327.  
  8328.   Changes the name of the disk Untitled to Backup.
  8329.  
  8330.   Rename -c File1 File2
  8331.  
  8332.   Changes the name of File1 to that of File2; if a conflict occurs,
  8333.   it cancels the operation and returns a status of 4.
  8334.  
  8335.   To perform a wildcard rename, you could execute the following set
  8336.   of commands:
  8337.  
  8338.   For Name In ≈.text
  8339.     ( Evaluate {Name} =~ /(≈)®1.text/ ) > Dev:Null
  8340.     Rename {Name} {®1}.p
  8341.   End
  8342.  
  8343.   The Evaluate command is executed only for its side effect of permitting
  8344.   regular expression processing. (The expression operator =~ indicates
  8345.   that the right side of the expression is a regular expression.) Thus,
  8346.   you can use the regular expression capture mechanism, (regularExpr)®n.
  8347.   Evaluate’s output is tossed in the bit bucket (Dev:Null).
  8348.  
  8349.  
  8350.                              See also 
  8351.  
  8352.   Move command.
  8353.  
  8354. æKY Replace
  8355. æC                   Replace -- replace the selection
  8356.  
  8357. Replace [-c count] selection replacement [window]
  8358.  -c count                # repeat the replace count times
  8359.  
  8360. Status codes returned:
  8361.   0    At least one instance of the selection was found.
  8362.   1    Syntax error.
  8363.   2    Any other error.
  8364.  
  8365.                            Description
  8366.  
  8367.   Replace finds selection in the specified window and replaces it with
  8368.   replacement. If no window is specified, the command operates on the
  8369.   target window (the second window from the front). It’s an error to
  8370.   specify a window that doesn’t exist. If a count is specified, the
  8371.   Replace command is repeated count times.
  8372.  
  8373.   For a definition of selection, see “Selections” in Chapter 6 of the MPW
  8374.   manual. A summary of the selection syntax is contained in Appendix B.
  8375.  
  8376.   You can include references to parts of the selection in the replacement
  8377.   by using the ® operator. The expression ®n, where n is a digit, is
  8378.   replaced with the string of characters that matches the regular expression
  8379.   tagged by ®n in the selection. (See “Tagging Regular Expressions
  8380.   With the ® Operator” in Chapter 6.)
  8381.  
  8382.   The selection is a selection expression while replacement is a string
  8383.   (that could contain the ® operator). If replacement contains spaces
  8384.   or special characters, enclose it in quotation marks.
  8385.  
  8386.   All searches are by default not case sensitive. To specify case-sensitive
  8387.   matching, set the {CaseSensitive} variable before executing the command.
  8388.  
  8389.  
  8390.                              Examples
  8391.  
  8392.   Replace -c ∞ /myVar/ 'myVariable' Prog.p
  8393.  
  8394.   Replaces every subsequent instance of the selection with the string
  8395.   in single quotation marks.
  8396.  
  8397.   Replace -c 5 /•[ ]+/ ''
  8398.  
  8399.   Strips off all the spaces and tabs at the front of the next five
  8400.   lines in the file (and replaces them with the null string). This
  8401.   action takes place in the target window.
  8402.  
  8403.   Set HexNum “[0-9A-F]+”
  8404.   Set Spaces “[ ]+”
  8405.   Replace -c ∞ /({HexNum})®1{Spaces}({HexNum})®2/ ®1 ®2
  8406.  
  8407.   Defines two variables for use in the subsequent Replace command,
  8408.   and converts a file that contains two columns of hex digits (such
  8409.   as the icon list from ResEdit) into a single column of hex digits.
  8410.  
  8411.  
  8412.                              See also 
  8413.  
  8414.   Find and Clear commands.
  8415.  
  8416.   Chapter 6.
  8417.  
  8418.   Appendix B.
  8419.  
  8420. æKY Request
  8421. æC              Request -- request text from a dialog box
  8422.  
  8423. Request [-q] [-d default] [message…] < file 
  8424.  -q                      # don't set status if user selects cancel
  8425.  -d default              # set default response
  8426.  
  8427. Status codes returned:
  8428.   0    The OK button was selected.
  8429.   1    Syntax errors.
  8430.   4    The Cancel button was selected.
  8431.  
  8432.                            Description
  8433.  
  8434.   Request displays an editable text dialog box with OK and Cancel buttons
  8435.   and the prompt message. If you select the OK button, any text you
  8436.   type into the dialog box is written to standard output. The -d option
  8437.   lets you set a default response to the request.
  8438.  
  8439.  
  8440.                              Examples
  8441.  
  8442.   Set Exit 0
  8443.   Set FileName “`Request 'File to compile' -d “{Active}”`”
  8444.   If {FileName} ≠ “”
  8445.     Pascal “{FileName}” ≥≥ “{WorkSheet}”
  8446.   End
  8447.   Set Exit 1
  8448.  
  8449.   Displays a dialog box that lets the user enter the name of a file
  8450.   to be compiled. Sets the default to be the name of the active window,
  8451.   as follows:
  8452.  
  8453. æKY ResEqual
  8454. æC           ResEqual -- compares the resources in two files
  8455.  
  8456. ResEqual [-p] File1 File2
  8457.  -p                      # write progress information to diagnostics
  8458.  
  8459. Status codes returned:
  8460.   0    Resources match.
  8461.   1    Parameter or option error.
  8462.   2    Files don’t match.
  8463.  
  8464.                            Description
  8465.  
  8466.   ResEqual compares the resources in two files and writes their differences
  8467.   to standard output.
  8468.  
  8469.   ResEqual checks that each file contains resources of the same type
  8470.   and identifier as the other file; that the size of the resources
  8471.   with the same type and identifier are the same; and that their contents
  8472.   are the same.
  8473.  
  8474.  
  8475.                              Examples
  8476.  
  8477.   Resequal Sample Sample.rsrc
  8478.  
  8479.   Compares the resources in Sample and Sample.rsrc, writing the results
  8480.   to standard output.
  8481.  
  8482.   Limitations When the contents of resources are compared and a mismatch
  8483.   is found, the mismatch and the subsequent 15 bytes are written. ResEqual
  8484.   then continues the comparison, starting with the byte following the
  8485.   last displayed.
  8486.  
  8487.   If more than ten differences are detected in the same resource, the
  8488.   rest of the resource is skipped and processing continues with the
  8489.   next resource.
  8490.  
  8491.  
  8492.                              See also 
  8493.  
  8494.   Equal command. (The -r option of Equal compares the resource forks
  8495.   of files on a byte-by-byte basis, including the resource map.)
  8496.  
  8497. æKY ResEqualIIGS
  8498. æC         ResEqualIIGS -- compares the resources in two IIGS files
  8499.  
  8500. ResEqual [-p] File1 File2
  8501.  -p                      # write progress information to diagnostics
  8502.  
  8503. æKY Revert
  8504. æC           Revert -- revert window to previous saved state
  8505.  
  8506. Revert [-y] [window…]
  8507.  -y                      # revert to old version (without dialog)
  8508.  
  8509. Status codes returned:
  8510.   0    No errors.
  8511.   1    Parameter or option error.
  8512.   2    The specified window does not exist.
  8513.   3    A system error occurred.
  8514.   4    The Cancel button was selected.
  8515.  
  8516.                            Description
  8517.  
  8518.   Reverts the specified windows to their previously saved states. If
  8519.   no window is specified, Revert works on the target window. Revert
  8520.   displays a confirmation dialog box, but you can avoid this dialog
  8521.   box by using the -y option to revert unconditionally to the last
  8522.   saved version of the document.
  8523.  
  8524.  
  8525.                              Examples
  8526.  
  8527.   Revert
  8528.  
  8529.   Displays a confirmation dialog box for reverting the target window
  8530.   to its last saved state.
  8531.  
  8532.   Revert -y {Worksheet}
  8533.  
  8534.   Reverts unconditionally to last saved worksheet.
  8535.  
  8536.  
  8537.                              See also 
  8538.  
  8539.   Close and Save commands.
  8540.  
  8541. æKY Rez
  8542. æC                       Rez -- resource compiler
  8543.  
  8544. Rez [option…] [file…]  < file ≥ progress
  8545.     -a[ppend]               # merge resource into output resource file
  8546.     -align word | longword  # align resource to word or longword boundries
  8547.     -c[reator] creator      # set output file creator
  8548.     -d[efine] name[=value]  # equivalent to: #define macro [value]
  8549.     -i[nclude] pathname     # path to search when looking for  #include files
  8550.     -m[odification]         # don't change the output file's modification date
  8551.     -o file                 # write output to file (default Rez.Out)
  8552.     -ov                     # ok to overwrite protected resources when appending
  8553.     -p                      # write progress information to diagnostics
  8554.     -rd                     # suppress warnings for redeclared types
  8555.     -ro                     # set the mapReadOnly flag in output
  8556.     -s[earch] pathname      # path to search when looking for INCLUDE resources
  8557.     -t[ype] type            # set output file type
  8558.     -u[ndef] name           # equivalent to: #undef name
  8559.  
  8560. Status codes returned:
  8561.   0    No errors.
  8562.   1    Error in parameters.
  8563.   2    Syntax error in file.
  8564.   3    I/O or program error.
  8565.  
  8566.                            Description
  8567.  
  8568.   Rez compiles the resource fork of a file according to a textual description.
  8569.   The resource description file is a text file that has the same format
  8570.   as the output produced by DeRez, the resource decompiler. The data
  8571.   used to build the resource file can come directly from the resource
  8572.   description file(s) as well as from other text files (via #include
  8573.   and read directives in the resource description file) and from other
  8574.   resource files (via the include directive).
  8575.  
  8576.   Rez includes macro processing, full expression evaluation, and built-in
  8577.   functions and system variables. For information about Rez and the
  8578.   format of a resource description file, see Chapter 11 of the MPW manual. 
  8579.   For a summary of the format of a resource description file, see Appendix D.
  8580.  
  8581.  
  8582.                              Examples
  8583.  
  8584.   Rez Types.r Sample.r -o Sample
  8585.  
  8586.   Generates a resource fork for the file Sample, based on the descriptions
  8587.   in Types.r and Sample.r.
  8588.  
  8589.  
  8590.                              See also 
  8591.  
  8592.   DeRez and RezDet commands.
  8593.  
  8594.   Chapter 11 and Appendix D.
  8595.  
  8596.   Standard resource type declarations in the directory {RIncludes}:
  8597.  
  8598.     • Types.r
  8599.  
  8600.     • SysTypes.r
  8601.  
  8602.     • MPWTypes.r
  8603.  
  8604.     • Pict.r
  8605.  
  8606. æKY RezDet
  8607. æC            RezDet -- detect inconsistencies in resources
  8608.  
  8609. RezDet [option…] file…   > dump
  8610.  -b[ig]                  # read resources one at a time, not all at once
  8611.  -d[ump]                 # write -show information, plus headers, lists, etc.
  8612.  -l[ist]                 # write list of resources with minimum information
  8613.  -q[uiet]                # don't write any output, just set {Status}
  8614.  -r[awdump]              # write -dump information plus contents
  8615.  -s[how]                 # write information about each resource
  8616.  
  8617.  Note: Use at most one of -quiet, -list, -show, -dump, and -rawdump.
  8618.  
  8619. Status codes returned:
  8620.   0    No errors detected.
  8621.   1    Invalid options or no files specified.
  8622.   2    Resource format error detected.
  8623.   3    Fatal error—an I/O or program error was detected.
  8624.  
  8625.                            Description
  8626.  
  8627.   If no options are specified, RezDet investigates the resource fork
  8628.   of each file for damage or inconsistencies. The specified files are
  8629.   read and checked one by one. Output is generated according to the
  8630.   options specified.
  8631.  
  8632.   RezDet checks for the following conditions:
  8633.  
  8634.     • The resource fork is at least the minimum size. (There must
  8635.     be enough bytes to read a resource header.)
  8636.  
  8637.     • There is no overlap or space between the header, the resource
  8638.     data list, and the resource map. There should be no bytes between
  8639.     the EOF and the end of the resource map.
  8640.  
  8641.     • Each record in the resource data list is used once and only
  8642.     once. The last data item ends exactly where the data list ends.
  8643.  
  8644.     • Each item in the resource type list contains at least one reference;
  8645.     each sequence of referenced items starts where the previous resource
  8646.     type item’s reference list ended; and each item in the reference
  8647.     list is pointed to by one and only one resource type list item.
  8648.  
  8649.     • There are no duplicates in the resource type list.
  8650.  
  8651.     • Each name in the name list has one and only one reference,
  8652.     and the last name doesn’t point outside the name list.
  8653.  
  8654.     • There are no duplicate names in the name list. Duplicate names
  8655.     cause an advisory warning rather than a true error. This warning
  8656.     is given only if the -s, -d, or -r option is selected.
  8657.  
  8658.     • Each reference list item points to a valid data item and either
  8659.     has a name list offset of –1 or points to a valid name list offset.
  8660.  
  8661.     • Bits 7 (Unused), 1 (Changed), or 0 (Unused) should not be set
  8662.     in the resource attributes.
  8663.  
  8664.     • All names have a nonzero length.
  8665.  
  8666.   Fields are displayed as hexadecimal or decimal for numeric values,
  8667.   or as a hex dump with associated printable Macintosh characters.
  8668.   The characters newline ($0D), tab ($09) and null ($00) are displayed
  8669.   as “¬”, “Δ”, and “.”, respectively.
  8670.  
  8671.     • Note: RezDet does not use the Resource Manager and should not
  8672.     crash, no matter how corrupt the resource fork of the file.
  8673.  
  8674.  
  8675.                              Examples
  8676.  
  8677.   RezDet {SystemFolder}System
  8678.  
  8679.   Checks the System file for damage.
  8680.  
  8681.   RezDet -q Foo || Delete Foo
  8682.  
  8683.   Removes the file Foo if the resource fork is damaged.
  8684.  
  8685.   Limitations Duplicate resource name warnings are generated even if
  8686.   the names belong to resources of different types.
  8687.  
  8688.   The file attributes field in the resource map header is not validated.
  8689.  
  8690.   The Finder-specific fields in the header and resource map header
  8691.   are ignored.
  8692.  
  8693. æKY RezIIGS
  8694. æC                    RezIIGS -- resource compiler
  8695. RezIIGS [option…] [file…]  < file ≥ progress
  8696.  -c[reator] creator      # set output file creator
  8697.  -d[efine] name[=value]  # equivalent to: #define macro [value]
  8698.  -f[lag] SYSTEM | ROM    # set resource file attributes
  8699.  -i[nclude] pathname     # path to search when looking for  #include files
  8700.  -m[odification]         # don't change the output file's modification date
  8701.  -o file                 # write output to file (default RezIIGS.out)
  8702.  -p                      # write progress information to diagnostics
  8703.  -rd                     # suppress warnings for redeclared types
  8704.  -ro                     # set the mapReadOnly flag in output
  8705.  -s[earch] pathname      # path to search when looking for INCLUDE resources
  8706.  -t[ype] type            # set output file type
  8707.  -u[ndef] name           # equivalent to: #undef name
  8708.  
  8709. æKY RotateWindows
  8710. æC       RotateWindows -- send active (frontmost) window to back
  8711.  
  8712. RotateWindows [-r]
  8713.  -r                      # reverse rotation; bring bottom window to front
  8714.  
  8715. Status codes returned:
  8716.   0    No errors.
  8717.   1    Syntax error (error in parameters).
  8718.  
  8719.                            Description
  8720.  
  8721.   RotateWindows places the front MPW window in the back and brings
  8722.   the second window to the front. Multiple calls to RotateWindows rotate
  8723.   through all open MPW windows. RotateWindows brings only MPW windows
  8724.   to the front (desk accessory windows are not rotated). You might
  8725.   want to add this command to a menu, along with a command key equivalent.
  8726.   For example:
  8727.  
  8728.   AddMenu 'Extras' 'RotateWindows/®' 'RotateWindows'
  8729.  
  8730.  
  8731.                              Examples
  8732.  
  8733.   RotateWindows
  8734.  
  8735.   Puts the front MPW window in back, and brings the target MPW window
  8736.   to the front.
  8737.  
  8738.  
  8739.                              See also 
  8740.  
  8741.   StackWindows, SizeWindow, MoveWindow, and ZoomWindow commands.
  8742.  
  8743. æKY Save
  8744. æC                    Save -- save specified windows
  8745.  
  8746. Save [-a | window…]
  8747.  -a                      # save the contents of all windows
  8748.  
  8749. Status codes returned:
  8750.   0    No errors.
  8751.   1    Syntax error.
  8752.   2    Specified window does not exist.
  8753.  
  8754.                            Description
  8755.  
  8756.   Saves the contents of window or a list of windows to disk without
  8757.   closing them. The -a option saves all open windows. Save without
  8758.   any parameters saves the target window (the second window from the
  8759.   front).
  8760.  
  8761.  
  8762.                              Examples
  8763.  
  8764.   Save -a
  8765.  
  8766.   Saves all open windows.
  8767.  
  8768.   Save {Active} {Worksheet}
  8769.  
  8770.   Saves the Worksheet window and the contents of the active window.
  8771.  
  8772.  
  8773.                              See also 
  8774.  
  8775.   Close and Revert commands.
  8776.       
  8777. æKY SaveOnClose
  8778. æC                    SaveOnClose -- set save behavior when closing windows
  8779.  
  8780. SaveOnClose [-a | -d | -n] [window…]
  8781.  -a                  # always save upon close ("Close -y")
  8782.  -d                  # default behavior for Close
  8783.  -n                  # never save upon close ("Close -n")
  8784.  
  8785.                            Description
  8786.                                                                                  
  8787. This command selects an automatic behavior: save, do not save, or ask
  8788. whether to save when closing a window.  The -n option does not turn off 
  8789. the Save menu item, allowing the user to request saving explicitly. 
  8790.                                                                            
  8791.  
  8792. æKY Search
  8793. æC                  Search -- search files for pattern
  8794.  
  8795. Search [-b] [-s | -i] [-nf] [-r] [-q] [-f file] pattern [file…] < file > found
  8796.  -b                 # break "File/Line" from matched pattern
  8797.  -i                 # case insensitive search (overriding {CaseSensitive})
  8798.  -s                 # case sensitive search (overriding {CaseSensitive})
  8799.  -nf                # write "pattern not found" to standard error and set status = 2
  8800.  -ns                # return 0 when pattern not found
  8801.  -q                 # suppress file name and line number in output
  8802.  -r                 # write non-matching line to standard output
  8803.  -sf                # stop at first match
  8804.  -f file            # lines not written to output are put in this file
  8805.  
  8806. Status codes returned:
  8807.   0    No error.
  8808.   1    Syntax error.
  8809.   2    Pattern not found.
  8810.  
  8811.                            Description
  8812.  
  8813.   Searches the input files for lines that contain a pattern and writes
  8814.   those lines to standard output. If no file is given, standard input
  8815.   is searched. When reading from files, the filenames and line numbers
  8816.   of matching lines are prepended to each line of output.
  8817.  
  8818.   Pattern (defined in “Pattern Matching” in Chapter 6 of the MPW manual and 
  8819.   in Appendix B) is a regular expression, optionally enclosed in forward 
  8820.   slashes ( / ).
  8821.  
  8822.  
  8823.                              Examples
  8824.  
  8825.   Search /procedure/ Sample.p
  8826.  
  8827.   Searches the file Sample.p for the pattern “procedure”. All lines
  8828.   containing this pattern are written to standard output.
  8829.  
  8830.   Search /Export/ {MPW}StartUp {MPW}UserStartUp
  8831.  
  8832.   Lists the Export commands in the StartUp and UserStartup files.
  8833.  
  8834.   Search /PROCEDURE [a-zA-Z0-9_]*;/ {PInterfaces}≈
  8835.  
  8836.   Searches for the procedures with no parameters in the Pascal interface
  8837.   files supplied with MPW Pascal. Because more than one input file
  8838.   is specified, a filename will precede each line in the output.
  8839.  
  8840.   Search -f file.nonmatch /pattern/ file
  8841.  
  8842.   All lines of “file” that contain “pattern” are written to standard
  8843.   output. All other lines will be placed in file.nonmatch. This, in
  8844.   effect, splits the file in two pieces, using “pattern” as the key.
  8845.  
  8846.   Search -r -f file.nonmatch /pattern/ file
  8847.  
  8848.   This does the opposite of the preceding example. All lines that do
  8849.   not contain “pattern” are echoed to standard output, and all other
  8850.   lines (that is, those containing “pattern”) are written to file.nonmatch.
  8851.  
  8852.  
  8853.                              See also 
  8854.  
  8855.   Find command.
  8856.  
  8857.   “Pattern Matching (Using Regular Expressions)” in Chapter 6.
  8858.  
  8859. æKY Set
  8860. æC               Set -- define or write Shell variables
  8861.  
  8862. Set [name [value]]   > variableList
  8863.  
  8864. Status codes returned:
  8865.   0    No error.
  8866.   1    Syntax error.
  8867.   2    Variable “name” does not exist.
  8868.  
  8869.                            Description
  8870.  
  8871.   Set assigns the string value to the variable name. If value is omitted,
  8872.   Set writes the name and its current value to standard output. If
  8873.   both name and value are omitted, Set writes a list of all variables
  8874.   and their values to standard output. (This output is in the form
  8875.   of Set commands.)
  8876.  
  8877.     • Note: To make variable definitions available to enclosed scripts
  8878.     and programs, you must use the Export command.
  8879.  
  8880.  
  8881.                              Examples
  8882.  
  8883.   Set CIncludes “{MPW}CFiles:CIncludes:”
  8884.  
  8885.   Redefines the variable CIncludes.
  8886.  
  8887.   Set CIncludes
  8888.  
  8889.   Displays the new definition of CIncludes.
  8890.  
  8891.   Set Commands ∂
  8892.   “:,{MPW}Tools:,{MPW}Applications:,{MPW}ShellScripts:”
  8893.  
  8894.   Redefines the variable {Commands} to include the directory “{MPW}ShellScripts:”.
  8895.   (See Chapter 5 for a complete list of predefined variables.)
  8896.  
  8897.   Set > SavedVariables
  8898.   # ... other commands
  8899.   Execute SavedVariables
  8900.  
  8901.   Writes the values of all variables to file SavedVariables. Because
  8902.   the output of Set is actually Set commands, the file can be executed
  8903.   later to restore the saved variable definitions. This technique is
  8904.   used in the Suspend and Resume scripts to save and restore variable
  8905.   definitions, as well as exports, aliases, and menus.
  8906.  
  8907.  
  8908.                              See also 
  8909.  
  8910.   Export, Unexport, and Unset commands.
  8911.  
  8912.   “Defining and Redefining Variables” in Chapter 5.
  8913.  
  8914.   “The Startup and UserStartup Files” in Chapter 5.
  8915.  
  8916. æKY SetDirectory
  8917. æC             SetDirectory -- set the default directory
  8918.  
  8919. SetDirectory directory
  8920.  
  8921. Status codes returned:
  8922.   0    Successful completion.
  8923.   1    Parameter error or unable to set directory.
  8924.  
  8925.                            Description
  8926.  
  8927.   SetDirectory sets the default directory and adds the new default
  8928.   directory to the Directory menu if it is not already present. The
  8929.   directory parameter must be specified.
  8930.  
  8931.     • Note: Directory names should not contain any of the special
  8932.     characters shown below. These characters all have special meaning
  8933.     when they appear in menu items:
  8934.  
  8935.   - ; ^ ! < / (
  8936.  
  8937.   The SetDirectory script is used to implement the Set Directory menu
  8938.   item in the Directory menu.
  8939.  
  8940.  
  8941.                              Examples
  8942.  
  8943.   SetDirectory {MPW}Scripts:
  8944.  
  8945.   Sets the default directory to the Scripts folder in the {MPW} directory
  8946.   and adds {MPW}Scripts: to the Directory menu if it’s not already
  8947.   there.
  8948.  
  8949.   SetDirectory…
  8950.  
  8951.   Uses the Commando dialog box to select the default directory interactively.
  8952.  
  8953.  
  8954.                              See also 
  8955.  
  8956.   Directory, DirectoryMenu, and Files commands.
  8957.  
  8958. æKY SetFile
  8959. æC                   SetFile -- set file/folder attributes
  8960.  
  8961. SetFile [option…] file/folder…
  8962.  -a attributes         # attributes (lowercase = 0, uppercase = 1)
  8963.  -c creator            # file creator
  8964.  -d date               # creation date (mm/dd/yy [hh:mm[:ss] [AM | PM]])*
  8965.  -l h,v                # ICON location (horizontal,vertical)*
  8966.  -m date               # modification date (mm/dd/yy [hh:mm[:ss] [AM | PM]])*
  8967.  -t type               # file type
  8968.  
  8969.  Note: Period (.) represents the current date and time.
  8970.  Note: The following attributes may be used with the -a option:
  8971.      L   Locked
  8972.      V   Invisible*
  8973.      B   Bundle
  8974.      S   System
  8975.      I   Inited*
  8976.      D   Desktop*
  8977.      M   Shared (can run multiple times)
  8978.      A   Always switch launch (if possible)
  8979. *Note: Options/attributes marked with an asterisk (*) are allowed with folders
  8980.  
  8981. Status codes returned:
  8982.   0    The attributes for all files were set.
  8983.   1    Syntax error.
  8984.   2    An error occurred.
  8985.       
  8986.  
  8987.                            Description
  8988.  
  8989.   Sets attributes for one or more files. The options apply to all files
  8990.   listed.
  8991.  
  8992.  
  8993.                              Examples
  8994.  
  8995.   SetFile -c “MPS ” -t MPST ResEqual
  8996.  
  8997.   Sets the creator and type for the MPW Pascal tool ResEqual.
  8998.  
  8999.   SetFile Foo -m “2/15/86 2:25”
  9000.  
  9001.   Sets the modification date of file Foo.
  9002.  
  9003.   SetFile Foo Bar -m .
  9004.  
  9005.   Sets the modification date to the current date and time (the period
  9006.   is a parameter to -m, indicating current date and time). Setting
  9007.   the date is useful, for instance, before running Make.
  9008.  
  9009.  
  9010.                              See also 
  9011.  
  9012.   Files command. (The -l and -x options display file information.)
  9013.  
  9014. æKY SetPrivilege
  9015. æC  SetPrivilege -- set access privileges for directories on file servers
  9016.  
  9017. SetPrivilege [option…] directory…  > information
  9018.     -d privileges           # set privileges for seeing directories
  9019.     -f privileges           # set privileges for seeing files
  9020.     -g group                # make the directories belong to group
  9021.     -i                      # return information on directories
  9022.     -m privileges           # set privileges for making changes
  9023.     -o owner                # make owner the owner of directories
  9024.     -r                      # operate (set or list) recursively
  9025.  
  9026.     Note: The following privilege characters may be used with
  9027.     the -d, -f, or -m options (Upper case enables the privilege,
  9028.     lower case disables it):
  9029.          O   Owner
  9030.          G   Group
  9031.          E   Everyone
  9032.  
  9033. Status codes returned:
  9034.   0    No error.
  9035.   1    Syntax error.
  9036.   2    Folder not found, or folder not an AppleShare folder.
  9037.   3    User is not owner; could not modify privileges.
  9038.  
  9039.                            Description
  9040.  
  9041.   Using SetPrivilege is equivalent to using the access privileges desk
  9042.   accessory. Priv is a character string (one, two or three characters
  9043.   long) that specifies privileges for the owner, the group, and everyone
  9044.   (o, g, and e, respectively). An uppercase letter enables the privilege;
  9045.   a lowercase letter disables the privilege. If a specific character
  9046.   is not in the string, the respective privilege is not changed.
  9047.  
  9048.  
  9049.                              Examples
  9050.  
  9051.   SetPrivilege -r -f OGe -d OGe -m Oge ∂
  9052.   “Server:personal:peter”
  9053.  
  9054.   This gives everyone in your group the ability to see files within
  9055.   Server:personal:peter without being able to change them. Anyone outside
  9056.   the group cannot see the files or folders or make changes. The owner
  9057.   can do everything.
  9058.  
  9059.   Here is the easiest way to use the SetPrivilege command: Use the
  9060.   -i option to get information on folders and edit the privileges as
  9061.   desired. Then execute the resulting command. For example, to change
  9062.   the privileges for Server:Private, follow these steps:
  9063.  
  9064.   1. Execute this command to obtain the current privileges:
  9065.  
  9066.   SetPrivilege -i Server:Private
  9067.  
  9068.   SetPrivilege Server:Private -o Joe -g Team -d OGE -f OGE -m OGE
  9069.  
  9070.     • Note: These privileges show that Joe, the group Team, and everyone
  9071.     else has all privileges to the folder Private.
  9072.  
  9073.   2. Now edit the output, adjusting the privileges as desired. For
  9074.   example,
  9075.  
  9076.   SetPrivilege Server:Private -o Joe -g Team -d Oge -f Oge -m Oge
  9077.  
  9078.     • Note: Now only Joe, the owner, can see directories and files.
  9079.     Only Joe can make changes; all other users have no privileges.
  9080.  
  9081.   3. Execute the resulting command.
  9082.  
  9083. æKY SetVersion
  9084. æC          SetVersion -- maintain version and revision number
  9085.  
  9086. SetVersion [option…] file  > output ≥ progress
  9087.  -b                    # increment the bug fix component by 1
  9088.  -country name         # country code name
  9089.  -csource file         # update the #define Version string in C source
  9090.  -d                    # display (updated) version numbers to standard output
  9091.  -fmt nƒ.mƒ            # format version numbers according to specification
  9092.  -i resid              # use specified resource id instead of 0
  9093.  -p                    # write SetVersion's version info to diagnostic file
  9094.  -prefix prefix        # prefix version with specified prefix
  9095.  -[p]source file       # update the Version string constant in Pascal source
  9096.  -r                    # increment the revision component by 1
  9097.  -rezsource file       # update the resource definition in Rez source
  9098.  -sb bugfix            # set the bug fix component to the specified value
  9099.  -sr revision          # set the revision component to the specified value
  9100.  -stage stage          # set release stage for a 'vers' resource
  9101.  -suffix suffix        # suffix the version with specified suffix
  9102.  -sv version           # set the version component to the specified value
  9103.  -sx nonrel            # set the non-release component to the specified value
  9104.  -sync 1 | 2           # synchronize 'vers',1 with 'vers',2 or vice versa
  9105.  -t type               # use specified resource type
  9106.  -v                    # increment the version component by 1
  9107.  -verid identifier     # use C/Pascal source version id instead of "Version"
  9108.  -version fmtstring    # alternate way of specifying version component actions
  9109.  -verstring longstring # set the long version string of a Finder 'vers' resource
  9110.  -x                    # increment the non-release component by 1
  9111.  
  9112. Status codes returned:
  9113.   0    Normal termination.
  9114.   1    Parameter or option error.
  9115.  
  9116.                            Description
  9117.  
  9118.   SetVersion generates and maintains (sets or increments) the individual
  9119.   components making up a version number for a file. There are two forms
  9120.   of version numbering supported by SetVersion:
  9121.  
  9122.   ver.rev The first version numbering form is “ver.rev”, where ver
  9123.   is a version number and rev a revision number. The component values
  9124.   are kept in a private resource generated and maintained by SetVersion
  9125.   itself. The resource is generally used only by applications (for
  9126.   example, in their About box) and MPW tools (for example, when an
  9127.   MPW tool’s -p option is used) that contain code to read the resource.
  9128.   It is also recognized by Commando to be displayed just below the
  9129.   Do It button of a Commando dialog box1.
  9130.  
  9131.   In this form of version numbering, the resource is maintained as
  9132.   a Pascal string with the resource type 'MPST' and a resource ID of
  9133.   0 (you can use the -t and -i options to specify another resource
  9134.   type and ID number if desired). The resource has the following layout
  9135.   (described as Rez input):
  9136.  
  9137.  
  9138.                              Examples
  9139.  
  9140.   setversion -d -sv 1 -r Example -psource Globals -rezsource Example.r
  9141.  
  9142.   The MPW tool Example contains a SetVersion 'MPST' string resource.
  9143.   The above command line increments the revision for the tool (-r)
  9144.   in the resource fork of the file Example. The version is fixed at
  9145.   1 (-sv), so that Example displays the version and revision as “1.rev”.
  9146.   The Pascal include file, Globals, contains the tool’s global declarations,
  9147.   including the Version string. This include file is updated to match
  9148.   the 'MPST' resource (-psource). The resource definitions for the
  9149.   tools, in Example.r, will be similarly updated (-rezsource). Finally,
  9150.   this command displays the new version of the standard output file
  9151.   (-d).
  9152.  
  9153.   setversion -d -version 1.Δ Example -psource Globals -rezsource Example.r
  9154.  
  9155.   Same as previous example, but here we illustrate how the -version
  9156.   option serves the same purpose as the -sv and -r options. Here the
  9157.   “Δ” indicates that the revision is to be incremented.
  9158.  
  9159.   setversion -d -version 1.2.%bΔ Example -psource Globals ∂
  9160.   -rezsource Example.r
  9161.  
  9162.   Again an 'MPST' SetVersion string resource is to be generated. But
  9163.   here we use a more complex version number. The version is set to
  9164.   1, the revision to 2, the bug fix level is left alone (“%”), this
  9165.   is a beta (b) release, and finally the nonrelease level is to be
  9166.   incremented.
  9167.  
  9168.   SetVersion SetVersion -psource SetVersion.p -version 3.Δ -t vers -i 1 ∂
  9169.   -d -verstring “^, ©Apple Computer, Inc. 1984-1988, by Ira L. Ruben”
  9170.  
  9171.   SetVersion SetVersion -version 3.0b1 -t vers -i 2 -verstring “MPW
  9172.   3.0b1”
  9173.  
  9174.   This pair of SetVersion commands generates both Finder 'vers',1 and
  9175.   'vers',2 resources. The Finder Get Info display shown earlier illustrates
  9176.   the result of using these commands. The MPW tool, SetVersion, has
  9177.   its own version number, 3.Δ (the revision is incremented for version
  9178.   3) set as a 'vers',1 resource (-t 'vers', -i 1). A long version message
  9179.   is specified by the -verstring option. The version number from the
  9180.   short message string is inserted into the long string at the position
  9181.   indicated by the “^” character. The generated version number is displayed
  9182.   to the standard output (-d) file. It is also used to update the Pascal
  9183.   source file constant (-psource).
  9184.  
  9185.   The second SetVersion command set the 'vers',2 resource (-t 'vers',
  9186.   -i 2). The version is set unconditionally to 3.0b1 and the long message
  9187.   string to “MPW 3.0b1”. MPW 3.0b1 is the MPW release, and SetVersion
  9188.   is just one of the files that belong to this release.
  9189.  
  9190.   The last example illustrates how both 'vers' resources should be
  9191.   used. The 'vers',1 resource is the individual file version while
  9192.   the 'vers',2 is the version release of a product that “owns” the
  9193.   file. The last example also should give some idea of how to arrange
  9194.   makefiles, specifically makefile macro definitions, to make the version
  9195.   numbering automatic and general. The following example illustrates
  9196.   this. It is the actual macro definitions and the SetVersion calls
  9197.   used to build SetVersion itself. They are taken as is from SetVersion’s
  9198.   makefile.
  9199.  
  9200.   MPWversion = 3.0b1                # product release version
  9201.   Copyright = ©Apple Computer, Inc. # copyright notice
  9202.   ver2 = MPW {MPWversion}           # long msg string for 'ver',2
  9203.   ver1 = ^, {Copyright}             # long msg string for 'ver',1
  9204.   - - -
  9205.  
  9206.   SetVersionVer = -sv 3 -r          # SetVersion's component controls
  9207.   Stage = -stage rel -sb 0          # Stage used by tools in makefile
  9208.   - - -
  9209.  
  9210.   SetVersion {LinkedTools}SetVersion -psource {ToolsDir}SetVersion.p ∂
  9211.   {SetVersionVer} -t vers -i 1 {stage} -d ∂
  9212.                   -verstring “{ver1} 1984-1988, by Ira L. Ruben”
  9213.  
  9214.   SetVersion {LinkedTools}SetVersion -version {MPWversion} -t vers ∂
  9215.              -i 2 -verstring “{ver2}”
  9216.   - - -
  9217.  
  9218.   The macro definitions specify the common aspects of the build; that
  9219.   is,
  9220.  
  9221.     • {MPWVersion}—the MPW release (which can be changed by a Make -d
  9222.     option when Make is called).
  9223.  
  9224.     • {Copyright}—the copyright string (which is concatenated into
  9225.     the 'vers',1 long message string).
  9226.  
  9227.     • {ver1}—the long string for the 'vers',2 resource (note it uses
  9228.     the MPW release string—we could have used a “^” here), which
  9229.     is to be displayed at the top of the Finder’s Get Info window.
  9230.  
  9231.     • {ver2}—the long string for the 'vers',1 resource (here we do
  9232.     use the “^”), which is to be displayed as the tools’ individual
  9233.     version number (we use only version and revision numbers).
  9234.  
  9235.     • {SetVersionVer}—a macro that defines the numbering control
  9236.     for the individual tool (the makefile is used to make other tools
  9237.     so there is one of these for each individual tool made).
  9238.  
  9239.     • {Stage}—Used just to insure that only ver.rel is generated
  9240.     in the 'vers',1 resource.
  9241.  
  9242.   The two SetVersion calls are similar to the previous example, but
  9243.   here they are part of a makefile, and we use the macros.
  9244.  
  9245.   1 Commando only uses the SetVersion string resource if a “VersionDialog”
  9246.   is specified as part of the Commando resources. If omitted, Commando
  9247.   will look for a 'vers' resource(s).
  9248.  
  9249.   2 When Commando uses a 'vers' resource, it first will look for a
  9250.   'vers' ,1 resource, and if not present, a 'vers' ,2 resource. The
  9251.   short version string is displayed below the Do It button. Clicking
  9252.   this version number causes the long version string to be displayed
  9253.   in the “help” box. The two 'vers' resources as well as the strings
  9254.   they contain are described when the 'vers' resource format is described.
  9255.  
  9256.   3 The comparison of the BCD field is only valid if the version number
  9257.   components don’t exceed the limitations imposed by the resource.
  9258.   Specifically, the version and nonrelease values are limited to two
  9259.   BCD digits, while the revision and bug fix values are limited to
  9260.   one digit. Because of these limitations, SetVersion does not use
  9261.   the BCD value. SetVersion does, however, place the low-order digits
  9262.   of the actual version components (maintained in the short message)
  9263.   into the BCD fields. The BCD field is thus valid until the version
  9264.   counts exceed the corresponding BCD limitations.
  9265.  
  9266.   4 See the -t option for a summary of which options are valid as a
  9267.   function of which resource (SetVersion’s string or Finder’s 'vers'
  9268.   resource) is being manipulated.
  9269.  
  9270.   5 The country names are spelled exactly as specified in Inside Macintosh
  9271.   for the International Utilities.
  9272.  
  9273. æKY Shift
  9274. æC         Shift -- renumber command file positional parameters
  9275.  
  9276. Shift [number]
  9277.  
  9278. Status codes returned:
  9279.   0    Success.
  9280.   1    Syntax error.
  9281.  
  9282.                            Description
  9283.  
  9284.   Shift renames the command script positional parameters {number+1},
  9285.   {number+2}… to {1}, {2}, and so on. If number is not specified, the
  9286.   default value is 1. Parameter 0 (the command name) is not affected.
  9287.   The variables {Parameters}, {Parameters}, and {#} variables are also
  9288.   modified to reflect the new parameters.
  9289.  
  9290.  
  9291.                              Examples
  9292.  
  9293.   The following script repeats a command once for each parameter:
  9294.  
  9295.   ### Repeat - Repeat a command for several parameters ###
  9296.   #
  9297.   #         Repeat command parameter…
  9298.   #         Execute command once for each parameter in the
  9299.   #         parameter list. You can specify options by
  9300.   #         including them in quotes with the command name.
  9301.   #
  9302.   Set d {1}
  9303.   Loop
  9304.     Shift
  9305.     Break If {1} == ""
  9306.     {cmd} "{1}"
  9307.   End
  9308.  
  9309.   In the preceding example, the Shift command is used to step through
  9310.   the parameters. The Break command tells the loop when all the parameters
  9311.   have been used. You might, for example, use the following Repeat
  9312.   script to compile several C programs with progress information:
  9313.  
  9314.   Repeat 'C -p' Sample.c Count.c Memory.c
  9315.  
  9316.  
  9317.                              See also 
  9318.  
  9319.   “Parameters” in Chapter 5.
  9320.       
  9321. æKY ShowSelection
  9322. æC          ShowSelection -- place the selection within an editor window
  9323.  
  9324. ShowSelection [-t | -b | -c | -n lines | -l line] [window]
  9325.  -t                   # place first line of selection at top of window
  9326.  -b                   # place first line of selection at bottom of window
  9327.  -c                   # center the first line within the window
  9328.  -n lines             # place first line of selection lines from the top
  9329.  -l line              # place line at the top of window
  9330.  
  9331. æKY Shutdown
  9332. æC             Shutdown -- power down or restart the machine
  9333.  
  9334. Shutdown [-y | -n | -c] [-r]
  9335.  -y                  # save all modified windows (avoids dialog)
  9336.  -n                  # do not save any modified windows (avoids dialog)
  9337.  -c                  # cancel if a window needs to be saved (avoids dialog)
  9338.  -r                  # restart the machine
  9339.  
  9340. Status codes returned:
  9341.   1    Syntax error.
  9342.   2    Command aborted.
  9343.        Note: Shutdown cannot return a status of 0 because if there are no 
  9344.        errors the command never returns.
  9345.  
  9346.                            Description
  9347.  
  9348.   Shutdown quits MPW and then either shuts down or reboots the Macintosh.
  9349.   The default is shutdown. Before rebooting the computer, the system
  9350.   executes standard quit procedures, asking for confirmation to save
  9351.   modified files, close all windows, and so on.
  9352.  
  9353.     • Note: Under MultiFinder, Shutdown does not give other active
  9354.     applications the chance to save their documents.
  9355.  
  9356.  
  9357.                              Examples
  9358.  
  9359.   Shutdown -y
  9360.  
  9361.   Shuts down the machine, answering “Yes” to any dialogs such as those
  9362.   prompting to save files.
  9363.  
  9364.  
  9365.                              See also 
  9366.  
  9367.   Quit command.
  9368.  
  9369. æKY SizeWindow
  9370. æC                  SizeWindow -- set a window's size
  9371.  
  9372. SizeWindow  [h v] [window]
  9373.  h                       # window width (horizontal)
  9374.  v                       # window height (vertical)
  9375.  
  9376. Status codes returned:
  9377.   0    No errors.
  9378.   1    Syntax error (error in parameters).
  9379.   2    The specified window does not exist.
  9380.   3    The h v size specified is too big.
  9381.  
  9382.                            Description
  9383.  
  9384.   Sets the size of the specified window to be h by v pixels, where
  9385.   h and v are nonnegative integers referring to the horizontal and
  9386.   vertical dimensions, in that order. (Use a blank space to separate
  9387.   the numbers h and v on the command line.) The default window is the
  9388.   target (second from the front) window; a specific window can optionally
  9389.   be specified. If the size specified would cause the window to be
  9390.   too big for the screen, an error is returned.
  9391.  
  9392.  
  9393.                              Examples
  9394.  
  9395.   SizeWindow 200 200
  9396.  
  9397.   Makes the target window 200 pixels square in size.
  9398.  
  9399.   SizeWindow {Active}
  9400.  
  9401.   A SizeWindow command with no parameters displays the size of the
  9402.   specified window:
  9403.  
  9404.   SizeWindow 500 100 {Worksheet}
  9405.  
  9406.   Makes the Worksheet window 500 x 100 pixels in size.
  9407.  
  9408.  
  9409.                              See also 
  9410.  
  9411.   MoveWindow, RotateWindows, StackWindows, TileWindows, and ZoomWindow
  9412.   commands.
  9413.  
  9414. æKY Sort
  9415. æC                  Sort -- sort or merge lines of text
  9416.  
  9417. Sort [option…] [files…]
  9418.  -b                      # skip leading blanks of each field
  9419.  -check                  # check if input is sorted (exit code 5 if not).
  9420.  -d                      # sort fields as decimal numbers
  9421.  -f field[,field]        # specify fields to sort on (see below)
  9422.  -fs string              # specify field separator characters
  9423.  -l                      # convert to lowercase before comparison
  9424.  -merge                  # merge pre-sorted input files
  9425.  -o file                 # specify output file, allows sorting-in-place
  9426.  -p                      # print version and progress information
  9427.  -quote                  # handle fields with quotes
  9428.  -stdin                  # place-holder for standard input (acts like a file)
  9429.  -r                      # reverse order of comparison
  9430.  -t                      # sort fields as text (default)
  9431.  -u                      # convert to uppercase before comparison
  9432.  -unique                 # write only unique output lines
  9433.  -x                      # sort fields as hexadecimal numbers (leading '$'
  9434.                          #   or '0x' is ignored)
  9435.  
  9436.  The comma-separated field specifications (following -f) take the forms:
  9437.  
  9438.          [F][.C][-K][bdlqrtux]
  9439.      or  [F][.C][+N][bdlqrtux]
  9440.  
  9441.  'F' is a field number (0=whole line [default], 1=first word, 2=second word…).
  9442.  'C' is the starting column number (from 1), default=1.
  9443.  'K' is the ending column number >= C, default=infinite.
  9444.  'N' is the maximum number of characters in the field, default=infinite.
  9445.  Only one of '-K' or '+N' can be specified.
  9446.  
  9447.  The local modifier characters 'bdlqrtux' have the same meaning on a
  9448.  per-field basis as -b, -d, -l, -q, -r, -t, -u and -x (which take effect
  9449.  globally).
  9450.  
  9451. Status codes returned:
  9452.   0    No errors.
  9453.   1    Syntax error on command line.
  9454.   2    Any other error.
  9455.   4    Out of memory.
  9456.   5    Input is not sorted.
  9457.  
  9458.                            Description
  9459.  
  9460.   Sort sorts or merges the specified files and prints the result on
  9461.   the standard output. If no input files are specified, standard input
  9462.   is assumed.
  9463.  
  9464.   Fields and Field Specifications
  9465.  
  9466.   The -f option (see “Options” ) precedes a comma-separated list of
  9467.   field specifications. Lines are sorted by extracting and comparing
  9468.   the fields in the order specified until a comparison yields inequality.
  9469.   If a field exists in one line but not the other, the line that possesses
  9470.   the field wins. If neither line has a field, the lines are considered
  9471.   equal. Fields not sorted are output randomly (Sort is not a stable
  9472.   sort).
  9473.  
  9474.   Each of the field specifications takes one of the forms:
  9475.  
  9476.   [F][.C][-K][modifiers]
  9477.  
  9478.   [F][.C][+N][modifiers]
  9479.  
  9480.   F is a field number, C and -K are column numbers, and +N is a character
  9481.   count. Any of the items may be omitted, provided that at least one
  9482.   item appears. The numbers -K and +N are mutually exclusive. Spaces
  9483.   can appear anywhere in the specification (except within numbers),
  9484.   but they must be Shell-quoted.
  9485.  
  9486.   Fields are numbered from 1. A field is a string of characters surrounded
  9487.   by newlines or field separator characters (usually whitespace; see
  9488.   the -fs option). Typically field 1 would be the first word on the
  9489.   line, field 2 the second word, and so on. Field 0 represents the
  9490.   entire line and is the default if a field number is not specified.
  9491.   Field separator characters are treated as normal text (not separators)
  9492.   in field 0.
  9493.  
  9494.   Columns are numbered from 1. If .C is specified, it represents a
  9495.   starting offset into the field, taking into account the (file-dependent)
  9496.   varying width of tab characters, if necessary. .C defaults to 1 if
  9497.   it is not specified.
  9498.  
  9499.   If -K is specified it represents the last column to be included in
  9500.   the field. It defaults to infinity (the maximum K possible) if not
  9501.   specified. Except for field 0, fields are always terminated by field-separator
  9502.   characters, so a large K does not mean “the rest of the line.”
  9503.  
  9504.   If +N is specified, it represents the number of characters to be
  9505.   included in the field (this differs from -K in that tabs are always
  9506.   counted as single characters). It defaults to infinity (the maximum
  9507.   N possible) if not specified.
  9508.  
  9509.   Here is a short description of all possible field specifications:
  9510.  
  9511.     F         The entirety of field F.
  9512.     F.C       Columns C…∞ in field F.
  9513.     F.C-K     Columns C…K in field F.
  9514.     F.C+N     N characters starting at column C in field F.
  9515.     F-K       Columns 1…K in field F.
  9516.     F+N       The first N characters in field F.
  9517.     .C        Columns C…∞ in the whole line.
  9518.     .C-K      Columns C…K in the whole line.
  9519.     .C+N      N characters starting at column C in the whole line.
  9520.     -K        Columns 1…K in the whole line.
  9521.     +N        The first N characters of the whole line.
  9522.  
  9523.   A field specification may be followed by one or more modifier characters:
  9524.  
  9525.     r         Reverse order of comparison (reverses -r).
  9526.     b         Ignore leading blanks (reverses -b).
  9527.     q         Interpret quotes when extracting field (reverses -quote).
  9528.     d x t l u Treat field as decimal (d), hexadecimal (x), normal text
  9529.               (t), lowercase text (l) or uppercase text (u). These modifiers are
  9530.               mutually exclusive.
  9531.  
  9532.   These modifiers override the corresponding command line options on
  9533.   a field-by-field basis (r, q, and b flip the meaning of -r, -quote,
  9534.   and -b).
  9535.  
  9536.   When sorting multiple files, each file can have its own tab setting.
  9537.   When comparing column-aligned fields, Sort correctly handles tabs
  9538.   of varying width, even when comparing records from different files.
  9539.  
  9540.  
  9541.                              Examples
  9542.  
  9543.   Sort Able -stdin Baker -o Output
  9544.  
  9545.   Sort the files Able, Baker, and the standard input, with output to
  9546.   file Output.
  9547.  
  9548.   Sort -x -f '2.2+8, 1tr' Frog
  9549.  
  9550.   Sort the file Frog. The first key to sort on consists of eight characters
  9551.   starting at the second column of the second field, treated as a hexadecimal
  9552.   number. The second key to sort on is merely the text of the first
  9553.   field, in reverse order.
  9554.  
  9555.   Sort -p -merge -u one two three infinity
  9556.  
  9557.   Merge the specified files, treating lowercase characters as uppercase.
  9558.   Print version and progress information.
  9559.  
  9560. æKY StackWindows
  9561. æC             StackWindows -- arrange windows diagonally
  9562.  
  9563. StackWindows [-h num] [-v num] [-r top,left,bottom,right] [-i] [windows…]
  9564.  -h num                  # horizontal offset between windows
  9565.  -v num                  # vertical offset between windows
  9566.  -r t,l,b,r              # rectangle in which to stack windows
  9567.  -i                      # include the worksheet
  9568.  windows…                # list of windows to tile
  9569.  
  9570. Status codes returned:
  9571.   0    No errors.
  9572.   1    Syntax error (in parameters).
  9573.  
  9574.                            Description
  9575.  
  9576.   Automatically sizes and moves all of the open Shell windows (except
  9577.   the Worksheet) so that they are staggered diagonally across the screen.
  9578.   Use StackWindows when selecting windows from the Window menu; this
  9579.   makes dealing with many open windows easier.
  9580.  
  9581.   If no windows are specified, all open Shell windows (except the Worksheet)
  9582.   are stacked up. Additionally you can specify the horizontal and vertical
  9583.   staggering constants; otherwise staggering defaults to five pixels
  9584.   horizontally and 20 pixels vertically. You can also include the Worksheet
  9585.   by using the -i option.
  9586.  
  9587.  
  9588.                              Examples
  9589.  
  9590.   StackWindows
  9591.  
  9592.   Stacks all of the Shell windows, excluding the Worksheet, in a neat
  9593.   and orderly fashion.
  9594.  
  9595.   StackWindows -i -v 20 -h 10 {active} {target}
  9596.  
  9597.   Stacks the top two windows, including the Worksheet, with a vertical
  9598.   spacing of 20 pixels and a horizontal spacing of 10 pixels.
  9599.  
  9600.  
  9601.                              See also 
  9602.  
  9603.   MoveWindow, RotateWindow, SizeWindow, TileWindows, and ZoomWindow
  9604.   commands.
  9605.       
  9606. æKY StreamEdit
  9607. æC              StreamEdit -- scriptable text editor
  9608.  
  9609. StreamEdit [option…] file…
  9610.     -d                      # delete lines (don't copy them)
  9611.     -e statements           # add 'statements' to the script
  9612.     -o file                 # direct output to file in a "safe" manner
  9613.     -p                      # print progress information
  9614.     -s file                 # specify a file containing a script to execute
  9615.     -set variable[=string]  # set the value of a variable
  9616.  
  9617.     A script consists of zero or more of:
  9618.     
  9619.         <address> <command>…
  9620.  
  9621.     Addresses take the forms (highest to lowest precedence):
  9622.     
  9623.         ( address )             # override precedence
  9624.         ! address               # match line not matching the address
  9625.         address1 && address2    # match line matching address1 AND address2
  9626.         address1 || address2    # match line matching address1 OR address2
  9627.         address1 , address2     # match address1…address2
  9628.         /regular expression/    # a line that matches the expression
  9629.         •                       # matches BEFORE the first line
  9630.         N                       # matches the Nth line
  9631.         $                       # matches the last line
  9632.         ∞                       # matches AFTER the last line
  9633.  
  9634.     A regular expression starting with 'ç' is case-sensitive.  Any '•' must
  9635.     follow the 'ç'.
  9636.  
  9637.     Commands are:
  9638.     
  9639.         Append <text>           # append text to append buffer
  9640.         Exit [status]           # exit with zero or specified status
  9641.         Change <text>           # set contents of edit buffer
  9642.         Delete                  # clear contents of edit buffer
  9643.         Insert <text>           # append text to insert buffer
  9644.         Next                    # proceed with next line
  9645.         Print <text>            # Print the text
  9646.              [-To file ]        #    directed to the specified file
  9647.              [-AppendTo file]   #    appended to the specified file
  9648.         Replace /pat/ <text>    # do replacement
  9649.                 [-c count]      # specify repeat count (N or ∞)
  9650.         Set variable <text>     # set variable's value
  9651.             [-a]                #    append to variable's current value
  9652.             [-i]                #    insert at front of variable's current value
  9653.         Option AutoDelete       # append "1,$ Delete" to script
  9654.     
  9655.     Where <text> consists of zero or more of:
  9656.     
  9657.         "a string"              # the specified text
  9658.         'a string'              # the specified text
  9659.         .                       # the current line (the edit buffer)
  9660.         variableName            # the contents of the named string variable
  9661.         ®N                      # an "®" variable set by a regular expression
  9662.         -from <filename>        # the next line from the file, where filename
  9663.                                 #    is a string or a variable name
  9664.         -n                      # suppress newline at end
  9665.  
  9666.     If <text> is empty, it defaults to "." (the current line).
  9667.             
  9668.                                        Description
  9669.                                                                                              
  9670. StreamEdit is an "offline" text editor similar to the Unix™ tool sed; it provides scriptable 
  9671. text matching and editing operations.  [It is not compatible with Unix™ sed or awk].  It is 
  9672. useful for making repetitive changes to files, for extracting information from text files, or 
  9673. as a filter.
  9674.  
  9675. StreamEdit takes a script and a set of input files (or standard input, if no input files are 
  9676. specified) and applies each statement in the script to each line of input, writing the output 
  9677. to standard output or the specified output file.
  9678.  
  9679. The script is specified by one or more -e or -s options.  If more than one script is 
  9680. specified, the resulting script is the concatenation of all the scripts.  If no script is 
  9681. specified (and -d is not specified), the script effectively defaults to
  9682.  
  9683.      1,$ Print
  9684.  
  9685. which has the effect of simply copying the input lines to the output.
  9686.  
  9687.  
  9688. A script consists of a series of statements of the form:
  9689.  
  9690.      address-expression command [ ; command … ]
  9691.  
  9692. Commands are separated by newlines or semi-colons.  All the commands following a 
  9693. particular address, up to the next address, are executed when the address matches.
  9694.  
  9695. A command takes the form:
  9696.  
  9697.      command-name [ text-arguments … ]
  9698.  
  9699. Arguments are terminated by newlines and semi-colons (while addresses may span 
  9700. multiple lines).
  9701.  
  9702. Address expressions, commands and command arguments are described below.
  9703.  
  9704.  
  9705. Empty lines are legal.  Comments begin with a sharp sign (#).  Semi-colons are equivalent 
  9706. to line breaks (unless they appear as the first character on a line), as in the Shell, and are 
  9707. used to terminate commands.  Newlines (outside of strings) may be escaped to extend an 
  9708. argument list.
  9709.  
  9710. If a script line contains a semi-colon in the first column, the entire line is treated as a 
  9711. comment by StreamEdit.  This allows you to write StreamEdit scripts that also contain 
  9712. MPW shell commands.  See the Examples section for more details.
  9713.  
  9714.                             Examples
  9715.                                                                                     
  9716.              Extracting the Leaf Part of a File Name
  9717.                                        
  9718. It is sometimes necessary to extract the leaf part of a complete file path name in a Shell 
  9719. script.  The StreamEdit expression:
  9720.  
  9721. /(≈:)*([¬:]*)®1/
  9722.  
  9723. sets the variable ®1 to the part of the file name following the last colon, or the whole file 
  9724. name if there it doesn't contain a colon.  It could be used in a Shell script as a filter:
  9725.  
  9726. # {MPW}Scripts:FilterLeaf
  9727. StreamEdit -d -e '/(≈:)*([¬:]*)®1/ print ®1'
  9728.  
  9729. For example:
  9730.  
  9731. Echo "The:I:Is:Silent:myFile" | FilterLeaf
  9732.  
  9733. would print:
  9734.  
  9735. myFile
  9736.  
  9737.  
  9738.                     Generating Inlines
  9739.                                                             
  9740. This is a script that generates MPW C or C++ inline function declarations from assembly 
  9741. language source.  It's far easier and less error-prone than hand-assembly or cut-and-paste; 
  9742. even though this script depends on the format of the listing file produced by the MPW 
  9743. Assembler, it is better to automate the process.
  9744.  
  9745. The script's usage is:
  9746.  
  9747. MakeCInline assemblyfile.a >outputFile
  9748.  
  9749. Given assembler input something like this:
  9750.  
  9751. ;+
  9752. ;  Inline Pascal string copy
  9753. ;
  9754. ;¥ void pascal_string_copy(char* src, char* dest);
  9755. ;
  9756. ;-
  9757.  proc
  9758.  movem.l (SP),A0-A1
  9759.  moveq   #0,D0
  9760.  move.b  (A1),D0
  9761.  bra.s   @2
  9762. @loop:   move.b   (A1)+,(A0)+
  9763. @2: dbra D0,@loop
  9764.  endproc
  9765.  
  9766. We want the filter to produce an inline declaration something like this:
  9767.  
  9768. void pascal_string_copy(char* src, char* dest) =
  9769. {0x4cef, 0x0300, 0x6b00, 0x1011, 0x6002, 0x10d9, 0x51c8, 0xfffc};
  9770.  
  9771. The character '¥' in the assembler comment marks the declaration; in principle any 
  9772. unique character or string can be used to flag the declaration.
  9773.  
  9774.  
  9775. The script has two parts; the first part contains MPW Shell commands, the rest of the 
  9776. script contains StreamEdit statements.
  9777.  
  9778. The MPW Shell part of the script is:
  9779.  
  9780. # MakeCInline -- make C assembly language inline declarations
  9781. ; asm "{1}" -l
  9782. ; StreamEdit -d -s "`which {0}`" "{1}".lst
  9783. ; Delete "{1}".lst "{1}".o
  9784. ; exit
  9785.  
  9786. It runs the assembler on the input file, producing a listing which is processed by the rest 
  9787. of the script.  Then the temporary files are removed and the MPW Shell part of the script 
  9788. exits; the Exit command ensures that the Shell doesn't execute any StreamEdit statements.
  9789.  
  9790. The invocation of StreamEdit here has an interesting hack; the name of the StreamEdit 
  9791. script to execute is, naturally, the name of the currently executing script.  So we use
  9792.  
  9793. `which {0}`
  9794.  
  9795. which expands into the name of the currently running shell script.
  9796.  
  9797.  
  9798. The rest of the file contains a StreamEdit script that processes the assembly listing 
  9799. produced above.  Here's an example of the assembler's listing output:
  9800.  
  9801. MC680xx Assembler - Ver 3.2d1          21-Nov-89  Page   1
  9802. Copyright Apple Computer, Inc. 1984-1989
  9803.  
  9804. Loc   F Object Code     Addr  MSource Statement
  9805.  
  9806.  case on
  9807.  ;+
  9808.  ;
  9809.  ; ¥ void pascal_string_copy(char* src, char* dest)
  9810.  ;
  9811.  ;-
  9812. 00000                       strcpy   proc   export
  9813. 00000   4CD7 0300            movem.l   (SP),A0-A1
  9814. 00004   7000                 moveq   #0,D0   
  9815. 00006   1011                 move.b   (A1),D0
  9816. 00008   6002        0000C    bra.s   @1
  9817. 0000A   10D9                @loop:   move.b   (A1)+,(A0)+
  9818. 0000C G 51C8 FFFC   0000A   @1:   dbra   D0,@loop
  9819. 00010                                endproc
  9820.  
  9821.                                 end
  9822.  
  9823. Elapsed time: 0.08 seconds.
  9824.  
  9825. Assembly complete - no errors found.  16 lines.
  9826.  
  9827.  
  9828.  
  9829. The opcodes we need are tantalizingly close … but embedded in goop that we need to 
  9830. strip away.  The first job is to extract the inline's declaration and copy it to the output.  
  9831. Hex constants must be separated by commas — we accomplish this with a variable, 
  9832. initially empty, that is set to a comma-and-space when a hex constant is emitted, so that a 
  9833. comma precedes every hex constant but the first one.
  9834.  
  9835. /;¥[ ∂t]*([¬;]*)®1/
  9836.  Print -n ®1 " =∂n{"
  9837.  Set PRECEEDING_COMMA ""
  9838.  Delete
  9839.  
  9840. The regular expression matches the inline declaration in the comment (which can be 
  9841. recognized by virtue of the marker string — "¥" — that we put there).  The text of the 
  9842. inline is extracted, omitting a possible trailing semicolon, and put into the variable ®1.  
  9843. The Print statement emits the inline declaration (in ®1) and extra stuff needed for C 
  9844. inline syntax.  The PRECEEDING_COMMA variable is set to empty, the line is deleted, 
  9845. and processing continues.
  9846.  
  9847.  
  9848. The inline declaration is terminated by an ENDP or an ENDPROC assembler directive:
  9849.  
  9850. /[ ∂t]ENDP/
  9851.  Print "};∂n"
  9852.  Delete
  9853.  
  9854. Next, totally uninteresting lines are deleted.  Examining the assembly listing, we note that 
  9855. the lines with the object code we need invariably contain a hex constant starting in the 
  9856. first column, several spaces (with an optional "G"), and at least one two-byte hex constant.  
  9857. We'll strip every line that doesn't meet these criteria, so there will be less noise to worry 
  9858. about.
  9859.  
  9860. !/•[0-9a-f]+ [ g] [0-9a-f]«4»/
  9861.  Delete
  9862.  
  9863. Then we simply delete any junk that precedes the hex constant we're interested in:
  9864.  
  9865. 1,$ Replace /[0-9a-f]+ [g ] /  ""
  9866.  
  9867. Now the line contains one word of assembler output that we can copy to the output:
  9868.  
  9869. /•([0-9a-f]«4»)®1 /
  9870.  Print -n PRECEEDING_COMMA "0x"®1
  9871.  Set PRECEEDING_COMMA ", "
  9872.  Replace // ""
  9873.  
  9874. We print an optional comma, followed by the hex constant itself.  Then we arrange for 
  9875. future constants to be preceded by a comma, and remove the constant from the front of 
  9876. the line.
  9877.  
  9878. Now we have a problem — there's no way to tell how many more constants have to be 
  9879. processed.  Furthermore, StreamEdit has no control structures for looping, so a count 
  9880. wouldn't help much anyway.  So we resort to a hack, namely, repeating the above code as 
  9881. many times as we're likely to ever need it for a single line of assembler output.
  9882.  
  9883. #
  9884. #  Convert remaining words
  9885. #  (I wish StreamEdit had looping!)
  9886. #
  9887. /•([0-9a-f]«4»)®1 /
  9888.  Print -n ", 0x"®1
  9889.  Replace // ""
  9890. /•([0-9a-f]«4»)®1 /
  9891.  Print -n ", 0x"®1
  9892.  Replace // ""
  9893. /•([0-9a-f]«4»)®1 /
  9894.  Print -n ", 0x"®1
  9895.  Replace // ""
  9896. /•([0-9a-f]«4»)®1 /
  9897.  Print -n ", 0x"®1
  9898.  Replace // ""
  9899.  
  9900. Examination of the assembler output shows that handling five constants on a line is more 
  9901. than enough.  However, if the assembler listing format changes, the script will break.
  9902.  
  9903.  
  9904.                       Unpacking Unix Shell Archives
  9905.                                                                   
  9906. This script unpacks a Unix shell archive, more commonly known as a shar file.  Shar files 
  9907. are used in the Unix community to gather text (say, the sources for a program, including 
  9908. its makefile) into a single file, suitable for transmittal by electronic mail or usenet.
  9909.  
  9910. Shar files typically have the form:
  9911.  
  9912. garbage at the beginning — mail headers and so forth
  9913. sed "s/^X//" >TheFile <<'END_OF_TheFile '
  9914. Xtext of the file
  9915. X  where each line
  9916. X    is preceded by an 'X'
  9917. END_OF_TheFile 
  9918. more files, similarly packed
  9919.  
  9920. The Unix shell and the tool sed cooperate to strip off the 'X's at the beginning of each 
  9921. line, and to direct the output to the correct file.  Unfortunately the MPW Shell does not 
  9922. have this kind of redirection, and StreamEdit is not sed, so we have to come up with our 
  9923. own solution.
  9924.  
  9925. To make matters worse, there is no single format for a shar file — in the Unix community 
  9926. it's "anything goes", as long as the standard Unix tools can unpack it.  A StreamEdit script 
  9927. to unpack an arbitrary shar file would have to closely emulate the Unix environment, 
  9928. which is rather difficult.  In practice, you'll have to tweak this script to handle different 
  9929. kinds of shar files.
  9930.  
  9931.  
  9932. The script starts with the usual MPW Shell commands to start up StreamEdit with the 
  9933. proper script, pass along the command-line parameters, and exit.  No surprises:
  9934.  
  9935. ; streamedit -d -s `which "{0}"` {parameters}
  9936. ; exit
  9937.  
  9938.  
  9939. The variable FILE holds the name of the current output file.  When we see a line beginning 
  9940. with "sed", we extract the output filename (possibly enclosed in quotes) and put it in the 
  9941. variable.
  9942.  
  9943. • Set FILE "DELETE.ME"         # for safety's sake
  9944.  
  9945. /•sed/ &&   (   />[ ∂t]*∂'([¬ ∂t]*)®1∂' /   # sed … >'quotedFile'
  9946.   ||
  9947.   />[ ∂t]*([¬ ∂t>]*)®1 /   # sed … >notQuotedFile
  9948.        )
  9949.   Set FILE ®1
  9950.   print "Extracting " FILE
  9951.  
  9952. For paranoia's sake, the FILE variable is initialized to "DELETE.ME", and the name of each 
  9953. file extracted is printed on standard output.
  9954.  
  9955. Extraction is simple — for every line beginning with an "X", the "X" is stripped off and the 
  9956. line is written to the current destination file.
  9957.  
  9958. /•X/
  9959.  replace // ""
  9960.  print -to FILE
  9961.    
  9962.                             See also
  9963.                                                                                           
  9964. Shell documentation on regular expressions.                                                                                          
  9965.    
  9966. æKY Target
  9967. æC              Target -- make a window the target window
  9968.  
  9969. Target name
  9970.  
  9971. Status codes returned:
  9972.   0    No errors.
  9973.   1    Error in parameters.
  9974.   2    The specified file does not exist.
  9975.   3    System error.
  9976.  
  9977.                            Description
  9978.  
  9979.   Makes window name the target window for editing commands (that is,
  9980.   the second window from the front). If window name isn’t already open,
  9981.   then file name is opened as the target window. If name doesn’t exist,
  9982.   an error is returned.
  9983.  
  9984.  
  9985.                              Examples
  9986.  
  9987.   Target Sample.a
  9988.  
  9989.   Makes the window Sample.a the target window.
  9990.  
  9991.  
  9992.                              See also 
  9993.  
  9994.   Open command.
  9995.  
  9996.   “Editing With the Command Language” in Chapter 5.
  9997.  
  9998. æKY TileWindows
  9999. æC          TileWindows -- arrange windows in a tiled fashion
  10000.  
  10001. TileWindows [-h | -v] [-r top,left,bottom,right] [-i] [windows…]
  10002.  -h                      # tile windows horizontally
  10003.  -v                      # tile windows vertically
  10004.  -r t,l,b,r              # rectangle in which to tile windows
  10005.  -i                      # include the worksheet
  10006.  windows…                # list of windows to tile
  10007.  
  10008. Status codes returned:
  10009.   0    No errors.
  10010.   1    Syntax error (error in parameters).
  10011.  
  10012.                            Description
  10013.  
  10014.   TileWindows automatically sizes and moves the specified Shell windows
  10015.   so that they are all visible on the screen at once. If no windows
  10016.   are specified, all open windows are tiled (except the Worksheet).
  10017.   Arranging your open windows like tiles and then zooming a selected
  10018.   window to full size makes dealing with many open windows much easier.
  10019.  
  10020.  
  10021.                              Examples
  10022.  
  10023.   TileWindows
  10024.  
  10025.   Arranges all of the Shell windows in a tile pattern, so that all
  10026.   are visible.
  10027.  
  10028.   TileWindows -h hd:new:main.c hd:new:foo.c
  10029.  
  10030.   Arranges the specified windows as two long horizontal strips.
  10031.  
  10032.   TileWindows -v {active} {target}
  10033.  
  10034.   Arranges the top two windows vertically.
  10035.  
  10036.  
  10037.                              See also 
  10038.  
  10039.   MoveWindow, RotateWindow, SizeWindow, StackWindows, and ZoomWindow
  10040.   commands.
  10041.  
  10042. æKY TransferCkid
  10043. æC  TransferCkid -- move Projector information from one file to another
  10044.  
  10045. TransferCkid sourceFile destinationFile 
  10046.  
  10047. Status codes returned:
  10048.   0    No errors.
  10049.   1    Syntax error.
  10050.   2    Error in processing.
  10051.  
  10052.                            Description
  10053.  
  10054.   Move the Projector 'CKID' resource from sourcefile to destinationfile.
  10055.  
  10056.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  10057.   symbols used in Projector commands.
  10058.  
  10059. æKY Translate
  10060. æC                  Translate -- translate characters
  10061.  
  10062. Translate [-p] [-s] src [dst] < file > output ≥ progress
  10063.     -p                    # write progress information to diagnostics
  10064.     -s                    # set font, font size, and tab setting of output
  10065.  
  10066. Status codes returned:
  10067.   0    Normal termination.
  10068.   1    Parameter or option error.
  10069.  
  10070.                            Description
  10071.  
  10072.   Standard input is copied to standard output, with input characters
  10073.   specified in the src (source) parameter string mapped into the corresponding
  10074.   characters specified by the dst (destination) parameter string; all
  10075.   other characters are copied as is. If dst is omitted, all characters
  10076.   represented by the src are deleted. If the dst string is shorter
  10077.   than the src, all characters in the src that would map to or beyond
  10078.   the last character in the dst are mapped into the last character
  10079.   in dst, and adjacent instances of such characters in the input are
  10080.   represented by a single instance of the last character in dst.
  10081.  
  10082.   Both src and dst are specified as a standard Shell character list
  10083.   but not enclosed in square brackets. Thus the src and dst are sequences
  10084.   of one or more characters (that is, an abcde) or a range of characters
  10085.   separated by a minus sign (that is, a–z, 0–9). Standard escape characters
  10086.   (such as ,
  10087.  
  10088.     • Note: Case sensitivity of letters specified in the src list
  10089.     are governed by the {CaseSensitive} Shell variable. If CaseSensitive
  10090.     is set to 1, then only letters specified in the src are mapped
  10091.     or deleted. If CaseSensitive is 0, then uppercase and lowercase
  10092.     letters not explicitly mapped into dst characters are mapped
  10093.     identically.
  10094.  
  10095.  
  10096.                              Examples
  10097.  
  10098.   translate a-z A-Z <origFile >ucFile
  10099.  
  10100.   Converts all lowercase letters in origFile to uppercase and writes
  10101.   the translated file to ucFile.
  10102.  
  10103.   translate 0-9 9 <origFile >outFile
  10104.  
  10105.   Converts each string of digits in origFile to the single digit 9
  10106.   in outFile.
  10107.  
  10108.   translate  
  10109.  
  10110.   Converts each run of blanks, tabs, or newline (return) characters
  10111.   in origFile to a single newline character in outFile. This effectively
  10112.   produces an output with just one word on each line. Note that the
  10113.   src string had to be quoted to specify the blank.
  10114.  
  10115.   translate ¬a-zA-Z    <origFile >outFile
  10116.  
  10117.   Removes all punctuation and isolates words by spaces on each line.
  10118.   Here we negated the src character list. Thus all characters except
  10119.   letters and newline characters are replaced with spaces.
  10120.  
  10121. æKY Unalias
  10122. æC                      Unalias -- remove aliases
  10123.  
  10124. Unalias [name…]
  10125.  
  10126. Status codes returned:   
  10127.   0    no errors.
  10128.  
  10129.                            Description
  10130.  
  10131.   Removes any alias definition associated with the alias name. (It
  10132.   is not an error if no definition exists for name.)
  10133.  
  10134.   s Caution If no names are specified, all aliases are removed.  s
  10135.  
  10136.   The scope of the Unalias command is limited to the current script;
  10137.   that is, aliases in enclosing scripts are not affected. If you are
  10138.   writing a script that is to be completely portable across various
  10139.   users’ configurations of MPW, you should place the command
  10140.  
  10141.   Unalias
  10142.  
  10143.   at the beginning of your script to make sure no unwanted substitutions
  10144.   occur.
  10145.  
  10146.  
  10147.                              Examples
  10148.  
  10149.   Unalias File
  10150.  
  10151.   Remove the alias “File”. (This alias is defined in the Startup file.)
  10152.  
  10153.  
  10154.                              See also 
  10155.  
  10156.   Alias command.
  10157.  
  10158.   “Command Aliases” in Chapter 5.
  10159.  
  10160. æKY Undo
  10161. æC                     Undo -- undo the last edit
  10162.  
  10163. Undo [window]
  10164.  
  10165. Status codes returned:
  10166.   0    No errors.
  10167.   1    Syntax error (error in parameters).
  10168.   2    Any other error.
  10169.  
  10170.                            Description
  10171.  
  10172.   Undo is the scriptable equivalent of choosing Undo from the Edit
  10173.   menu to reverse the last editing operation. Undo without any parameters
  10174.   acts on the target (that is, the second from the front) window. Optionally
  10175.   a named window can be specified.
  10176.  
  10177.     • Note: Remember that Undo is maintained on a window-by-window
  10178.     basis. Therefore using this command will undo the last edit operation
  10179.     that was performed in the specified window, which may or may
  10180.     not be the last operation actually performed.
  10181.  
  10182.  
  10183.                              Examples
  10184.  
  10185.   Undo
  10186.  
  10187.   Reverses the last edit operation in the target window.
  10188.  
  10189.   Undo {Worksheet}
  10190.  
  10191.   Reverses the last edit operation in the Worksheet window.
  10192.  
  10193.  
  10194.                              See also 
  10195.  
  10196.   Cut, Copy, and Paste commands.
  10197.  
  10198. æKY Unexport
  10199. æC     Unexport -- remove variable definitions from the export list
  10200.  
  10201. Unexport [-r | -s | name…]   > unexports
  10202.  -r                      # generate Export commands for all unexported variables
  10203.  -s                      # print the names only
  10204.  
  10205. Status codes returned:
  10206.   0    No error.
  10207.   1    Syntax error.
  10208.  
  10209.                            Description
  10210.  
  10211.   Removes the specified variables from the list of exported variables.
  10212.   The list of exported variables is local to a script, so unexported
  10213.   variables are removed only from the local list.
  10214.  
  10215.   If no names are specified, a list of unexported variables is written
  10216.   to standard output. The default output of Unexport is in the form
  10217.   of Unexport commands.
  10218.  
  10219.   (A variable that is not exported is considered unexported.)
  10220.  
  10221.  
  10222.                              Examples
  10223.  
  10224.   Set SrcDir HD:source:
  10225.   Export SrcDir # SrcDir is available to scripts and tools
  10226.   …
  10227.   Unexport SrcDir
  10228.  
  10229.   Now the variable SrcDir is no longer available to scripts and tools.
  10230.  
  10231.   Unexport -r
  10232.   Export var1
  10233.   Export var2
  10234.   …
  10235.  
  10236.   This example lists all the variables that are not exported. To export
  10237.   them, simply select and execute all the export commands.
  10238.  
  10239.   To get a list of all the variables that have not been exported, execute
  10240.   this command:
  10241.  
  10242.   Unexport -s
  10243.   var1
  10244.   var2
  10245.   ...
  10246.   varx
  10247.  
  10248.  
  10249.                              See also 
  10250.  
  10251.   Set and Export commands.
  10252.  
  10253. æKY Unmark
  10254. æC               Unmark -- remove a marker from a window
  10255.  
  10256. Unmark name… window
  10257.  
  10258. Status codes returned:
  10259.   0    No errors.
  10260.   1    Syntax error.
  10261.   2    Error in processing.
  10262.   3    System error.
  10263.  
  10264.                            Description
  10265.  
  10266.   Unmark removes the marker(s) name… , from the list of markers available
  10267.   for window. When a window is the current active window, the Mark
  10268.   menu item(s) will be adjusted.
  10269.  
  10270.  
  10271.                              Examples
  10272.  
  10273.   Unmark `Markers` {Target}
  10274.  
  10275.   Removes all markers associated with the target window.
  10276.  
  10277.   Unmark Proc1 {Active}
  10278.  
  10279.   Removes the “Proc1” marker from the active window’s marker list.
  10280.   Because {Active} is by definition the current active window, the
  10281.   Mark menu is also adjusted to reflect the deletion of the “Proc1”
  10282.   marker.
  10283.  
  10284.   Limitation Unmark does not support Undo.
  10285.  
  10286.  
  10287.                              See also 
  10288.  
  10289.   “Markers” in Chapter 6.
  10290.  
  10291. æKY Unmount
  10292. æC                     Unmount -- unmount volumes
  10293.  
  10294. Unmount volume…
  10295.  
  10296. Status codes returned:
  10297.   0    The volume was successfully unmounted.
  10298.   1    Syntax error.
  10299.   2    An error occurred.
  10300.  
  10301.                            Description
  10302.  
  10303.   Unmounts the specified volumes. A volume name must end with a colon
  10304.   ( : ). If volume is a number without a colon, it’s interpreted as
  10305.   a disk drive number. The unmounted volumes cannot be referenced again
  10306.   until remounted. If you unmount the current volume (the volume containing
  10307.   the current directory), the boot volume becomes the current volume.
  10308.  
  10309.  
  10310.                              Examples
  10311.  
  10312.   Unmount Memos:
  10313.  
  10314.   Unmounts the volume titled Memos.
  10315.  
  10316.   Unmount 1 2
  10317.  
  10318.   Unmounts the volumes in drives 1 (the internal drive) and 2 (the
  10319.   external drive). (The command Eject 1 2 would unmount and eject the
  10320.   volumes.)
  10321.  
  10322.  
  10323.                              See also 
  10324.  
  10325.   Eject and Mount commands.
  10326.  
  10327. æKY UnmountProject
  10328. æC                 UnmountProject -- unmount projects
  10329.  
  10330. UnmountProject -a | Project…
  10331.  -a                      # unmount all mounted projects
  10332.  
  10333. Status codes returned:
  10334.   0    No errors.
  10335.   1    Syntax error.
  10336.   2    Error in processing.
  10337.   3    System error.
  10338.  
  10339.                            Description
  10340.  
  10341.   Unmount projects mounted under Projector.
  10342.  
  10343.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  10344.   symbols used in Projector commands.
  10345.  
  10346.  
  10347.                              Examples
  10348.  
  10349.   To unmount all mounted projects use:
  10350.  
  10351.   UnmountProject -a
  10352.  
  10353.   To unmount the projects MyProject and YourProject use:
  10354.  
  10355.   UnmountProject MyProject YourProject
  10356.  
  10357.  
  10358.                              See also 
  10359.  
  10360.   MountProject.
  10361.  
  10362. æKY Unset
  10363. æC              Unset -- remove Shell variable definitions
  10364.  
  10365. Unset [name…]
  10366.  
  10367. Status codes returned:
  10368.  0    no errors.
  10369.  
  10370.                            Description
  10371.  
  10372.   Removes any variable definition associated with name. (It’s not an
  10373.   error if no definition exists for name.)
  10374.  
  10375.   • Caution If no names are specified, all variable definitions are
  10376.   removed. This can have serious consequences. For example, the Shell
  10377.   uses the variable {Commands} to locate utilities and applications
  10378.   and uses several other variables to set defaults. The assembler and
  10379.   compilers use variables to help locate include files. (For details,
  10380.   see “Variables Defined in the Startup File” in Chapter 5 of the MPW
  10381.   manual.)
  10382.  
  10383.   The scope of the Unset command is limited to the current script;
  10384.   that is, variables in enclosing scripts are not affected.
  10385.  
  10386.  
  10387.                              Examples
  10388.  
  10389.   Unset CaseSensitive
  10390.  
  10391.   Removes the variable definition for {CaseSensitive}. This turns off
  10392.   case-sensitive searching for the editing commands.
  10393.  
  10394.  
  10395.                              See also 
  10396.  
  10397.   Set, Export, and Unexport commands.
  10398.  
  10399.   “Defining and Redefining Variables” in Chapter 5.
  10400.  
  10401. æKY UserVariables
  10402. æC     UserVariables -- uses Commando to set all the user variables
  10403.  
  10404. æKY Version
  10405. æC                Version -- print the version of the MPW Shell
  10406.  
  10407. æKY Volumes
  10408. æC                   Volumes -- list mounted volumes
  10409.  
  10410. Volumes [-l] [-q] [volume…]  > volumeList
  10411.  -l                      # long format (name, drive, size, free, files, dirs)
  10412.  -q                      # don't quote volume names with special characters
  10413.  
  10414. Status codes returned:
  10415.   0    No errors.
  10416.   1    Syntax error.
  10417.   2    No such volume.
  10418.  
  10419.                            Description
  10420.  
  10421.   For each volume named, Volumes writes its name and any other information
  10422.   requested to standard output. The output is sorted alphabetically.
  10423.   A volume name must end with a colon ( : )—if volume is a number without
  10424.   a colon, it’s interpreted as a disk drive number. If volume is not
  10425.   given, all mounted volumes are listed.
  10426.  
  10427.  
  10428.                              Examples
  10429.  
  10430.   Volumes -l
  10431.  
  10432.   will write information such as
  10433.  
  10434.   Name   Drive   Size    Free   Files  Dirs
  10435.   _____ ______  _____   _____  ______ _____
  10436.   HD:      3    19171K  14242K    290   33
  10437.  
  10438.   Files `Volumes 1`
  10439.  
  10440.   Lists the files on the disk in drive 1 (the built-in 3.5-inch disk
  10441.   drive).
  10442.  
  10443. æKY WhereIs
  10444. æC               WhereIs  -- find the location of a file
  10445.  
  10446. WhereIs [-c] [-d] [-v] [-s directory]… pattern
  10447.  -c                      # completely match filepattern
  10448.  -d                      # include directories
  10449.  -v                      # verbose output - put summary line at end
  10450.  -s directory            # starting directory/volume for search
  10451.  
  10452. Status codes returned:
  10453.   0    No errors.
  10454.   1    Syntax error.
  10455.   2    File system error during processing.
  10456.   3    No matches were found.
  10457.  
  10458.                            Description
  10459.  
  10460.   Use WhereIs to find the location of all files that contain pattern
  10461.   as part of their filename. You can use WhereIs to find files hidden
  10462.   in the directory tree. Pattern is a full or partial filename. For
  10463.   example, a pattern of “test” will match TestProg.c, test.c, and Work:OutputTest.
  10464.   WhereIs starts searching in the root directory of the default volume
  10465.   and searches the entire disk. To constrain the search to a portion
  10466.   of a disk, or to specify different disks or multiple disks, use the
  10467.   -s option. To list any directories that contain pattern, use the
  10468.   -d option. To constrain the search to files that completely match
  10469.   pattern, use the -c option. The -v option prints the number of items
  10470.   matched with pattern. Matching is not case sensitive, and regular
  10471.   expressions are not supported.
  10472.  
  10473.   WhereIs lists the full pathname of all files and directories found.
  10474.   Files that contain special characters are quoted.
  10475.  
  10476.  
  10477.                              Examples
  10478.  
  10479.   WhereIs test
  10480.  
  10481.   Find all files that have “test” in their filename. The output would
  10482.   be something like
  10483.  
  10484.   HD:MPW:test.c
  10485.   HD:MPW:test.c.o
  10486.   HD:MPW:TestMenu.c
  10487.   HD:MPW:TestProg.p
  10488.  
  10489.   WhereIs -c test.c
  10490.  
  10491.   Find files named test.c. The output (with the same files as the example
  10492.   above) would be
  10493.  
  10494.   HD:MPW:test.c
  10495.  
  10496.   WhereIs -d test
  10497.  
  10498.   Find all files or directories that have “test” in their leafname.
  10499.   The output would be
  10500.  
  10501.   HD:MPW:TestDir:
  10502.   HD:MPW:test.c
  10503.   HD:MPW:test.c.o
  10504.   HD:MPW:TestMenu.c
  10505.   HD:MPW:TestProg.p
  10506.  
  10507.   WhereIs -s HD:MPW -s Disk2:Work test
  10508.  
  10509.   Find all files that have “test” in their pathname. Search for the
  10510.   files starting in HD:MPW and also in Disk2:Work.
  10511.  
  10512. æKY Which
  10513. æC         Which -- determine which file the shell will execute
  10514.  
  10515. Which [-a] [-p] [name]  > file ≥ progress
  10516.  -a                      # report all commands named "name"
  10517.  -p                      # writes progress information to diagnostics
  10518.  
  10519. Status codes returned:
  10520.   0    No error.
  10521.   1    Syntax error.
  10522.   2    Command not found.
  10523.   3    Other error.
  10524.  
  10525.                            Description
  10526.  
  10527.   Determines which command the Shell will execute when command is entered.
  10528.   Which looks for commands defined by aliases, Shell built-in commands,
  10529.   and commands accessible through the Shell variable {Commands} (the
  10530.   same order the Shell uses). If command is not specified, all paths
  10531.   in the {Commands} variable will be written to standard output, one
  10532.   directory per line. The directories are listed in the order in which
  10533.   the Shell would search for commands. In this case the -a and -p options
  10534.   have no meaning.
  10535.  
  10536.  
  10537.                              Examples
  10538.  
  10539.   Which asm
  10540.  
  10541.   This command outputs something like - HD:MPW:Tools:asm. The Shell
  10542.   then executes hd:MPW:Tools:asm when given asm.
  10543.  
  10544.   Which -a makeit
  10545.   Alias makeit 'make > tmp; tmp'
  10546.   HD:MPW:Tools:makeit
  10547.   HD:MPW:Scripts:makeit
  10548.  
  10549.   In this case, there are three different “makeit” commands that the
  10550.   Shell could execute, as determined by current aliases and the {Commands}
  10551.   variable. The Shell executes the first one found (the alias).
  10552.  
  10553.   Which newfolder
  10554.  
  10555.   newfolder
  10556.  
  10557.   In this case, newfolder is a Shell built-in command.
  10558.  
  10559. æKY Windows
  10560. æC                      Windows  -- list windows
  10561.  
  10562. Windows [-q]
  10563.  -q                      # don't quote window names with special characters
  10564.  -o                      # list "Open" command lines for execution
  10565.  
  10566. Status codes returned:
  10567.   0    No error.
  10568.   1    Syntax error.
  10569.  
  10570.                            Description
  10571.  
  10572.   Writes the full pathname of each file currently in a window. The
  10573.   names are written to standard output, one per line, from backmost
  10574.   to frontmost.
  10575.  
  10576.  
  10577.                              Examples
  10578.  
  10579.   Windows
  10580.  
  10581.   Lists the pathnames of all open windows.
  10582.  
  10583.   Print {PrintOptions} `Windows`
  10584.  
  10585.   Prints the pathnames of the open windows, using the options specified
  10586.   by the {PrintOptions} variable. This example uses command substitution:
  10587.   Because the Windows command appears in backquotes (`…`), its output
  10588.   supplies the parameters to the Print command.
  10589.  
  10590.   Echo “Open `Windows` || Set Status 0” > SavedWindows
  10591.  
  10592.   Writes a script in the file SavedWindows that will reopen the current
  10593.   set of open windows. Notice how Echo is used to create the script.
  10594.   The conditional || execution operator restores the status to zero
  10595.   should an error occur while opening the remembered windows. This
  10596.   technique is used in the script Suspend to save the list of open
  10597.   windows.
  10598.  
  10599. æKY ZoomWindow
  10600. æC           ZoomWindow -- enlarge or reduce a window's size
  10601.  
  10602. ZoomWindow [-b | -s] [window]
  10603.  -b                      # zoom to full screen (big)
  10604.  -s                      # zoom back to regular size (small)
  10605.  
  10606. Status codes returned:
  10607.   0    No errors.
  10608.   1    Syntax error (error in parameters).
  10609.   2    The specified window does not exist.
  10610.  
  10611.                            Description
  10612.  
  10613.   Zooms the specified window according to the option specified. The
  10614.   default window is the target (second from the front) window; a specific
  10615.   window can optionally be specified. The -s option forces the window
  10616.   to zoom back to its small size. The -b option forces the window to
  10617.   zoom to its full size. If no option is specified, the window toggles
  10618.   to the other size. ZoomWindow without any options mimics the operation
  10619.   of clicking in the window’s zoom box. This command is especially
  10620.   valuable when used in conjunction with StackWindows or TileWindows.
  10621.  
  10622.                              Examples
  10623.  
  10624.   ZoomWindow
  10625.  
  10626.   Zooms the target window to full screen size if the window was originally
  10627.   in the small size.
  10628.  
  10629.   ZoomWindow -s {Worksheet}
  10630.  
  10631.   Zooms the Worksheet window back to its small size.
  10632.  
  10633.  
  10634.                              See also 
  10635.  
  10636.   MoveWindow, RotateWindows, SizeWindow, StackWindows, and TileWindows
  10637.   commands.
  10638.  
  10639.   {ZoomWindowRect} variable in Chapter 5.
  10640.  
  10641.   The “full size” window is normally the entire screen. You can change
  10642.   it (for example, prevent it from covering the disk and trash icons)
  10643.   by specifying a rectangle in the Shell variable {ZoomWindowRect}.
  10644.